Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.3] Core deprecation notice logging #6389

Merged
merged 1 commit into from
Feb 19, 2017
Merged

[3.3] Core deprecation notice logging #6389

merged 1 commit into from
Feb 19, 2017

Conversation

GwendolenLynch
Copy link
Contributor

the deprecations are strong in this one

@GwendolenLynch GwendolenLynch added this to the Bolt 3.3 - Feature release milestone Feb 19, 2017
@GwendolenLynch
Copy link
Contributor Author

Deprecation counts based on unit test execution:

  • Before: 203
  • After: 69,213

@bobdenotter
Copy link
Member

Won't this affect performance adversely?

@GwendolenLynch
Copy link
Contributor Author

Won't this affect performance adversely?

Micro, and obviously only with debugging enabled.

This is how Symfony, Silex, and Twig (etc) all do, and literally where @CarsonF and I have been getting all of our recent low hanging pineapples deprecation removal up targets from

… and interestingly enough the discussion between Carson and I two years ago about being able to do this on core, was the start of the very long running attempts to get our exception handling sorted out.

In very basic terms, this is why languages like PHP — in this example — have trigger_error('', E_USER_DEPRECATED); so that developers can easily log and find parts of their code need to migrate to new calls/components/etc.

The @ silencer in this case become the extra magic.

What we now get with this, is a very clear picture of what it to be done, and how close we're getting, towards replacing both upstream and core use of legacy code.

Copy link
Member

@bobdenotter bobdenotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WFM. 👍

@bobdenotter bobdenotter merged commit ce7a0e4 into bolt:release/3.3 Feb 19, 2017
@GwendolenLynch GwendolenLynch deleted the hotfix/deprecation-notices branch February 19, 2017 19:28
@GwendolenLynch
Copy link
Contributor Author

It just occurred to me to leave this here for those that need it:

If you do not want the deprecation notices, nor the small overhead that it introduces when debugging is turned on only, you can adjust your debug_error_level setting in app/config/config.yml like so:

debug_error_level: 16383  # equivalent to E_ALL &~ E_USER_DEPRECATED

Copy link
Member

@CarsonF CarsonF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were going to create a wrapper function for this :(

@@ -45,6 +45,8 @@ public function __construct($directory, $extension = self::EXTENSION, $umask = 0
*/
public function clearCache()
{
@trigger_error(sprintf('%s is deprecated and will be removed in version 4.0. Use flushAll() instead.', __METHOD__));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing E_USER_DEPRECATED here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants