$instances
$instances : array
Cache for instance of any services that have been requested as a "shared" instance.
Services Configuration file.
Services are simply other classes/libraries that the system uses to do its job. This is used by CodeIgniter to allow the core of the framework to be swapped out easily without affecting the usage within the rest of your application.
This is used in place of a Dependency Injection container primarily due to its simplicity, which allows a better long-term maintenance of the applications built on top of CodeIgniter. A bonus side-effect is that IDEs are able to determine what class you are calling whereas with DI Containers there usually isn't a way for them to do this.
autoloader(boolean $getShared = true) : \CodeIgniter\Autoloader\Autoloader
The Autoloader class is the central class that handles our spl_autoload_register method, and helper methods.
boolean | $getShared |
locator(boolean $getShared = true) : \CodeIgniter\Autoloader\FileLocator
The file locator provides utility methods for looking for non-classes within namespaced folders, as well as convenience methods for loading 'helpers', and 'libraries'.
boolean | $getShared |
discoverServices(string $name, array $arguments) : mixed
Will scan all psr4 namespaces registered with system to look for new Config\Services files. Caches a copy of each one, then looks for the service method in each, returning an instance of the service, if available.
string | $name | |
array | $arguments |
Loading…