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

[2.7] Deprecated SecurityContextInterface interface and SecurityContext class #14847

Closed
Restless-ET opened this issue Jun 3, 2015 · 2 comments

Comments

@Restless-ET
Copy link
Contributor

Hello,

I'm trying to fix all the deprecated errors on my project. I've already fixed most of them, however there are some of them (shown below) for which I'm not being able to track down what's causing them.

Jun  3 11:21:07 container apache2: PHP Deprecated:  The Symfony\Component\Security\Core\SecurityContextInterface interface is deprecated since version 2.6 and will be removed in 3.0. in /srv/project/current/sf2/app/cache/dev/classes.php on line 2996
Jun  3 11:21:07 container apache2: PHP Stack trace:
Jun  3 11:21:07 container apache2: PHP   1. {main}() /srv/project/current/sf2/web/app_dev.php:0
Jun  3 11:21:07 container apache2: PHP   2. Symfony\Component\HttpKernel\Kernel->handle() /srv/project/current/sf2/web/app_dev.php:33
Jun  3 11:21:07 container apache2: PHP   3. Symfony\Component\HttpKernel\Kernel->boot() /srv/project/current/sf2/app/bootstrap.php.cache:2427
Jun  3 11:21:07 container apache2: PHP   4. Symfony\Component\HttpKernel\Kernel->doLoadClassCache() /srv/project/current/sf2/app/bootstrap.php.cache:2393
Jun  3 11:21:07 container apache2: PHP   5. Symfony\Component\ClassLoader\ClassCollectionLoader::load() /srv/project/current/sf2/app/bootstrap.php.cache:2558
Jun  3 11:21:07 container apache2: PHP   6. require_once() /srv/project/current/sf2/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php:91
Jun  3 11:21:07 container apache2: PHP   7. trigger_error() /srv/project/current/sf2/app/cache/dev/classes.php:2996

Jun  3 11:21:07 container apache2: PHP Deprecated:  The Symfony\Component\Security\Core\SecurityContext class is deprecated since version 2.6 and will be removed in 3.0. Use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage or Symfony\Component\Security\Core\Authorization\AuthorizationChecker instead. in /srv/project/current/sf2/app/cache/dev/classes.php on line 3008
Jun  3 11:21:07 container apache2: PHP Stack trace:
Jun  3 11:21:07 container apache2: PHP   1. {main}() /srv/project/current/sf2/web/app_dev.php:0
Jun  3 11:21:07 container apache2: PHP   2. Symfony\Component\HttpKernel\Kernel->handle() /srv/project/current/sf2/web/app_dev.php:33
Jun  3 11:21:07 container apache2: PHP   3. Symfony\Component\HttpKernel\Kernel->boot() /srv/project/current/sf2/app/bootstrap.php.cache:2427
Jun  3 11:21:07 container apache2: PHP   4. Symfony\Component\HttpKernel\Kernel->doLoadClassCache() /srv/project/current/sf2/app/bootstrap.php.cache:2393
Jun  3 11:21:07 container apache2: PHP   5. Symfony\Component\ClassLoader\ClassCollectionLoader::load() /srv/project/current/sf2/app/bootstrap.php.cache:2558
Jun  3 11:21:07 container apache2: PHP   6. require_once() /srv/project/current/sf2/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php:91
Jun  3 11:21:07 container apache2: PHP   7. trigger_error() /srv/project/current/sf2/app/cache/dev/classes.php:3008

I've already adjusted my code to make use of security.token_storage and security.authorization_checker instead of the security.context service so I'm failing to grasp where this is coming from.
Could this be coming from symfony itself?

Also, this only appears when using app_dev.php and only on the log file used by PHP (currently syslog) and not the symfony one.

I know that I can silence this by replacing Debug::enable() with Debug::enable(E_ALL & ~E_USER_DEPRECATED) at the app_dev.php but I would really prefer to understand where this is coming from and fix it if possible.

Thanks in advance for your feedback.

Best regards,

@xabbuh
Copy link
Member

xabbuh commented Jun 3, 2015

Thank you for reporting this issue @Restless-ET. However, this seems to be the same as #14831 which was fixed in #14837 and will be part of Symfony 2.7.1. So, I'm going to close here.

@xabbuh xabbuh closed this as completed Jun 3, 2015
@Restless-ET
Copy link
Contributor Author

Ok. I've checked open issues to see if there was already any related to this but that one was already closed that's why I've missed it.

I'll be waiting for version 2.7.1 then and meanwhile I'll just silence those errors.

Thank you for your feedback. :)

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

No branches or pull requests

2 participants