extends class Phalcon\DI\FactoryDefault
implements Phalcon\DiInterface
This is a variant of the standard Phalcon\DI. By default it automatically registers all the services provided by the framework. Thanks to this, the developer does not need to register each service individually. This class is specially suitable for CLI applications
Phalcon\DI\FactoryDefault\CLI constructor
Registers a service in the services container
Removes a service in the services container
Returns a service definition without resolving
Returns a Phalcon\DI\Service instance
Sets a service using a raw Phalcon\DI\Service definition
Resolves the service based on its configuration
Resolves a service, the resolved service is stored in the DI, subsequent requests for this service will return the same instance
Check whether the DI contains a service by a name
Check whether the last service obtained via getShared produced a fresh instance or an existing one
Return the services registered in the DI
Set a default dependency injection container to be obtained into static methods
Return the lastest DI created
Resets the internal default DI
Attempts to register a service in the services container Only is successful if a service hasn’t been registered previously with the same name
Registers an “always shared” service in the services container
...
Check if a service is registered using the array syntax. Alias for Phalcon\Di::has()
Allows to register a shared service using the array syntax. Alias for Phalcon\Di::setShared()
$di['request'] = new Phalcon\Http\Request();
Allows to obtain a shared service using the array syntax. Alias for Phalcon\Di::getShared()
var_dump($di['request']);
Removes a service from the services container using the array syntax. Alias for Phalcon\Di::remove()
Magic method to get or set services using setters/getters
...
© 2011–2016 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/2.0.0/api/Phalcon_DI_FactoryDefault_CLI.html