Download the PHP package getsky/phalcon-autoload-services without Composer
On this page you can find all versions of the php package getsky/phalcon-autoload-services. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download getsky/phalcon-autoload-services
More information about getsky/phalcon-autoload-services
Files in getsky/phalcon-autoload-services
Package phalcon-autoload-services
Short Description Components for automatic registration services in Dependency Injection
License MIT
Informations about the package phalcon-autoload-services
Component for automatic registration of services in DI
This component allows to register services in DI with the settings file.
The main features of the component:
- Services can be initialized with a string, object or service provider;
- Services are connected via a configuration file;
- Services can be registered as "shared" services;
Requirements:
- PHP 5.4
- Phalcon Framework
Phalcon framework: http://phalconphp.com/
Using
For registration services necessary to execute the code:
Configuring Services
There are three ways to register services:
-
By the class name. This method does not allow to pass arguments to a constructor or adjust parameters.
-
Registering an instance directly. When using this method the container is placed dependency already finished object.
- Through the service provider. Which must implement the interface . According to the plan, providers are intermediaries for registration of anonymous functions in the container dependency, but have the opportunity to realize any other way that supports Phalcon.
For the second and third method possible to specify which arguments are passed to the constructor and invoke methods since its inception and prior to placement in the DI. Below is an example of how it can be implemented on the ini:
In the above example, we register the service
under the name and pass 5 arguments: the service
, variable , DI (object implements ),
service caused by the method and an
instance of , which was first created with
transfer and calling .
All versions of phalcon-autoload-services with dependencies
ext-phalcon Version >=1.2.4,<2