Skip to content

Remove profiler storages #15944

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

Closed

Conversation

javiereguiluz
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

@Tobion
Copy link
Contributor

Tobion commented Sep 27, 2015

Please add the @deprecated phpdoc.

@fabpot
Copy link
Member

fabpot commented Sep 27, 2015

You also need to add @group legacy for test files related to the deprecated classes

@fabpot
Copy link
Member

fabpot commented Sep 27, 2015

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php should also be updated to trigger a deprecation notice for people not using the filesystem.

@javiereguiluz
Copy link
Member Author

Added @deprecated and @group legacy.

Deprecation of config options has been done in Configuration.php instead of the mentioned FrameworkExtension.php file. Is that correct?

@fabpot
Copy link
Member

fabpot commented Sep 27, 2015

LGTM

@Tobion
Copy link
Contributor

Tobion commented Sep 27, 2015

IMO the dsn config makes no sense as well (as you can see with the configs for usrname/password). A better approach would have been a storage config option that just accepts a service. Could we change that as well?


The web development toolbar has been completely redesigned. This update has
introduced some changes in the HTML markup of the toolbar items.
The web development toolbar has been completely redesigned. This update has
Copy link
Member

Choose a reason for hiding this comment

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

this should be a different bullet point. It is not the same change the deprecating import and export

@stof
Copy link
Member

stof commented Sep 28, 2015

status: needs work

@@ -27,6 +31,8 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface
*/
public function __construct($dsn, $username = '', $password = '', $lifetime = 86400)
{
@trigger_error('The '.__CLASS__.' class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

Same here

@javiereguiluz javiereguiluz force-pushed the remove_profile_storages branch from 5fac47d to 94f5e98 Compare September 30, 2015 06:45
@javiereguiluz
Copy link
Member Author

I've moved deprecation notices at the beginning of the classes.

->defaultValue('file:%kernel.cache_dir%/profiler')
->beforeNormalization()
->always()
->thenInvalid('The profiler.dsn configuration key must start with "file:" because all the storages except the filesystem are deprecated since version 2.8 and will be removed in 3.0.')
Copy link
Member

Choose a reason for hiding this comment

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

That's too strong. We should still accept other storage engines, but trigger a deprecation notice in such cases (same for the username and password).

You can see an example in the same file for csrf_protection.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@fabpot
Copy link
Member

fabpot commented Sep 30, 2015

👍

->scalarNode('dsn')
->defaultValue('file:%kernel.cache_dir%/profiler')
->beforeNormalization()
->always()
Copy link
Member

Choose a reason for hiding this comment

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

this should not be always. configuring a DSN is not deprecated entirely. It should not be triggered when it starts with file

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right. Changed by:

->ifTrue(function ($v) { return 'file:' !== substr($v, 0, 5); })

@@ -11,11 +11,16 @@

namespace Symfony\Component\HttpKernel\Profiler;

@trigger_error('The '.__NAMESPACE__.'\PdoProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

this should also be triggered for child classes IMO, as they are also deprecated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Thanks.

@stof
Copy link
Member

stof commented Sep 30, 2015

👍

@fabpot
Copy link
Member

fabpot commented Sep 30, 2015

Thank you @javiereguiluz.

@fabpot fabpot closed this in 8f44cc3 Sep 30, 2015
@fabpot fabpot mentioned this pull request Nov 16, 2015
@malarzm
Copy link
Contributor

malarzm commented Jul 7, 2016

I'm sorry for commenting on such old PR (especially I'm almost a year late here), but what were the reasons for deprecating and removing non-filesystem storages? I went through issues backlog/changelog/update files and only found PRs doing so without justification.

Reason I'm asking is that currently colleague of mine is working on moving us from Sf 2.8 to 3.x and I was a bit dazzled by the fact he added almost the same class as removed MongoDbProfilerStorage to get rid of deprecation. In our case we're using central profiler storage (and we have a web-based way to access stored profiles) which is the only way for collecting profiles from application ran on few servers (behind load balancer).

@alexgurrola
Copy link

@malarzm We've come across the same issue, and created a simple package to help with the transition to Symfony 3.0+.

@chadwickmeyer
Copy link

@fabpot @javiereguiluz @malarzm @alexgurrola We have the exact same issue with load balancers. Anyone who uses Symfony in an enterprise context (with more than one server) can no longer use the profiler as it's intended to be used.

And why was this removed in the first place? There doesn't seem to be any explanation of the rational for the removal of this extremely helpful feature.

@robfrawley
Copy link
Contributor

If you dug into the tickets referenced by this PR you would find #15939 which describes why it was done. While I don't agree with the rational, if you are looking for the explanation, it's already described there.

@javiereguiluz
Copy link
Member Author

Now that we'll have Symfony Flex soon, we may rethink some past decisions, like this one, and release those features as small packages (e.g. distributed-profiler or database-profiler).

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

Successfully merging this pull request may close these issues.

9 participants