-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit a314b65
committed
bug #52870 [SecurityBundle] Fix redeclaration of
This PR was squashed before being merged into the 6.4 branch.
Discussion
----------
[SecurityBundle] Fix redeclaration of `InternalSecurity` class when opcache preload is active
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues |
| License | MIT
When opcache.preload is active the `InternalSecurity` gets aliased twice.
I have security voter in project that injects `Symfony\Bundle\SecurityBundle\Security` and the `opcache.preload` php config is set.
Stack trace:
```
ErrorException:
Warning: Cannot declare class Symfony\Bundle\SecurityBundle\InternalSecurity, because the name is already in use
at vendor/symfony/security-bundle/Security.php:34
at include_once('/var/www/vendor/symfony/security-bundle/Security.php')
(var/cache/dev/ContainerSgUiPaP/App_KernelDevDebugContainer.php:6191)
at ContainerSgUiPaP\App_KernelDevDebugContainer::getSecurity_HelperService(object(App_KernelDevDebugContainer))
(var/cache/dev/ContainerSgUiPaP/App_KernelDevDebugContainer.php:3537)
at ContainerSgUiPaP\App_KernelDevDebugContainer::getImageVoter2Service(object(App_KernelDevDebugContainer))
(var/cache/dev/ContainerSgUiPaP/App_KernelDevDebugContainer.php:2198)
at ContainerSgUiPaP\App_KernelDevDebugContainer::getImageVoterService(object(App_KernelDevDebugContainer))
(var/cache/dev/ContainerSgUiPaP/App_KernelDevDebugContainer.php:4671)
at ContainerSgUiPaP\App_KernelDevDebugContainer::ContainerSgUiPaP\{closure}()
(vendor/symfony/security-bundle/DataCollector/SecurityDataCollector.php:135)
at Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector->collect(object(Request), object(Response), null)
(vendor/symfony/http-kernel/Profiler/Profiler.php:169)
at Symfony\Component\HttpKernel\Profiler\Profiler->collect(object(Request), object(Response), null)
(vendor/symfony/http-kernel/EventListener/ProfilerListener.php:108)
at Symfony\Component\HttpKernel\EventListener\ProfilerListener->onKernelResponse(object(ResponseEvent), 'kernel.response', object(TraceableEventDispatcher))
(vendor/symfony/event-dispatcher/Debug/WrappedListener.php:116)
at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(ResponseEvent), 'kernel.response', object(TraceableEventDispatcher))
(vendor/symfony/event-dispatcher/EventDispatcher.php:220)
at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.response', object(ResponseEvent))
(vendor/symfony/event-dispatcher/EventDispatcher.php:56)
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(ResponseEvent), 'kernel.response')
(vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:139)
at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ResponseEvent), 'kernel.response')
(vendor/symfony/http-kernel/HttpKernel.php:214)
at Symfony\Component\HttpKernel\HttpKernel->filterResponse(object(Response), object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:202)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:197)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:29)
at require_once('/var/www/vendor/autoload_runtime.php')
(public/index.php:5)
```
Commits
-------
4651fef [SecurityBundle] Fix redeclaration of `InternalSecurity` class when opcache preload is activeInternalSecurity
class when opcache preload is active (kaznovac)File tree
Expand file treeCollapse file tree
1 file changed
+3
-0
lines changedFilter options
- src/Symfony/Bundle/SecurityBundle
Expand file treeCollapse file tree
1 file changed
+3
-0
lines changedsrc/Symfony/Bundle/SecurityBundle/Security.php
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/
75F8
SecurityBundle/Security.php+3Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 |
| |
34 | 37 |
| |
35 | 38 |
| |
|
0 commit comments