Class BaseService

Summary

Fully Qualified Name: CodeIgniter\Config\BaseService

Description

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.

Methods

Name Description Defined By
__callStatic() Provides the ability to perform case-insensitive calling of service names. BaseService
autoloader() The Autoloader class is the central class that handles our spl_autoload_register method, and helper methods. BaseService
injectMock() Inject mock object for testing. BaseService
locator() The file locator provides utility methods for looking for non-classes within namespaced folders, as well as convenience methods for loading 'helpers', and 'libraries'. BaseService
reset() Reset shared instances and mocks for testing. BaseService

Method Details

__callStatic()

Provides the ability to perform case-insensitive calling of service names.

Parameter Name Type Description
$name string
$arguments array

Returns: mixed

autoloader()

The Autoloader class is the central class that handles our spl_autoload_register method, and helper methods.

Parameter Name Type Description
$getShared bool

Returns: \CodeIgniter\Autoloader\Autoloader

injectMock()

Inject mock object for testing.

Parameter Name Type Description
$name string
$mock
$mock

Returns:

locator()

The file locator provides utility methods for looking for non-classes within namespaced folders, as well as convenience methods for loading 'helpers', and 'libraries'.

Parameter Name Type Description
$getShared bool

Returns: \CodeIgniter\Autoloader\FileLocator

reset()

Reset shared instances and mocks for testing.

Parameter Name Type Description
$init_autoloader bool Initializes

Returns:

Top