Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OSE
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
OSE
Commits
6ccfc8f9
Commit
6ccfc8f9
authored
May 16, 2014
by
gauthierb
Browse files
Options
Downloads
Patches
Plain Diff
Ajout compatibilité avec les ControllerManager et FormElementManager.
parent
1bb9d8cc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
module/Application/src/Application/Service/ContextProviderAwareInitializer.php
+5
-0
5 additions, 0 deletions
...c/Application/Service/ContextProviderAwareInitializer.php
with
5 additions
and
0 deletions
module/Application/src/Application/Service/ContextProviderAwareInitializer.php
+
5
−
0
View file @
6ccfc8f9
...
...
@@ -4,6 +4,8 @@ namespace Application\Service;
use
Zend\ServiceManager\InitializerInterface
;
use
Zend\ServiceManager\ServiceLocatorInterface
;
use
Zend\Mvc\Controller\ControllerManager
;
use
Zend\Form\FormElementManager
;
/**
* Transmet à une instance le fournisseur de contexte si sa classe implémente l'interface qui va bien.
...
...
@@ -21,6 +23,9 @@ class ContextProviderAwareInitializer implements InitializerInterface
*/
public
function
initialize
(
$instance
,
ServiceLocatorInterface
$serviceLocator
)
{
if
(
$serviceLocator
instanceof
ControllerManager
||
$serviceLocator
instanceof
FormElementManager
)
{
$serviceLocator
=
$serviceLocator
->
getServiceLocator
();
}
if
(
$instance
instanceof
ContextProviderAwareInterface
&&
!
$instance
instanceof
ContextProvider
)
{
$instance
->
setContextProvider
(
$serviceLocator
->
get
(
'applicationContextProvider'
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment