Created
November 25, 2013 15:38
-
-
Save alanpich/7643199 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The above 2 files (and additionals for all included modules) are merged to form a config cache array | |
*/ | |
return array( | |
'factories' => array( | |
'my.foo.service' => 'Different\Library\Service\Factory\FooServiceFactory' | |
), | |
// Invokables are exactly that - invoke this class as-is | |
'invokables' => array( | |
'my.bar.service' => 'My\Service\BarService' | |
) | |
); | |
// Get a service by key. Instances are singletons, unless explicitly specified in config. | |
$fooService = $serviceLocator->get('my.foo.service'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
// Factories are either a class implementing FactoryInterface, or a callable $var | |
'factories' => array( | |
'my.foo.service' => 'My\Service\Factory\FooServiceFactory' | |
), | |
// Invokables are exactly that - invoke this class as-is | |
'invokables' => array( | |
'my.bar.service' => 'My\Service\BarService' | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'factories' => array( | |
'my.foo.service' => 'Different\Library\Service\Factory\FooServiceFactory' | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment