Class cAutoload
Implements autoload feature for a CONTENIDO project.
Autoloading for CONTENIDO is provided via a generated class map configuration file, which is available inside data/config/{environment}/ folder.
- data/config/{environment}/config.autoloader.php
Autoloading is extendable by adding a additional class map file inside the same folder, which could contain further class map settings or could overwrite settings of main class map file.
- data/config/{environment}/contenido/includes/config.autoloader.local.php
You can also add additional class map configuration by using function following functions:
- cAutoload::addClassmapConfig(array $config)
- cAutoload::addClassmapConfigFile($configFile)
Read also docs/techref/backend/backend.autoloader.html to get involved in CONTENIDO autoloader mechanism.
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Murat Purc <murat@purc.de>
Located at classes/class.autoload.php
public static
|
|
public static
|
#
addClassmapConfig( array $config )
Adding additional autoloader class map configuration. NOTE: Since this autoloader is implemented for CONTENIDO, it doesn't support to load classfiles being located outside of the CONTENIDO installation folder. |
public static
|
#
addClassmapConfigFile( string $configFile )
Adding additional autoloader class map configuration file. NOTE: Since this autoloader is implemented for CONTENIDO, it doesn't support to load classfiles being located outside of the CONTENIDO installation folder. |
public static
|
|
public static
boolean
|
#
isAutoloadable( string $file )
Checks, if passed filename is a file, which will be included by the autoloader. |
public static
array
|
|
public static
array
|
|
private static
string|null
|
#
_getContenidoClassFile( string $className )
Returns the path to a CONTENIDO class file by processing the given classname |
private static
string|null
|
#
_validateClassAndFile( string $classname, string $filename )
Validates the given classname and filename. |
private static
array
|
#
_normalizeConfig( array $config )
Normalizes the passed configuration array by returning a new copy of it which contains the keys in lowercase. This prevents errors by trying to load class 'foobar' if the real class name is 'FooBar'. |
private static
|
string |
ERROR_FILE_NOT_FOUND
|
'file_not_found' |
#
Identifier for error if class file could not be found. |
string |
ERROR_CLASS_EXISTS
|
'class_exists' |
#
Identifier for error if class already exists. |
private static
string
|
$_conRootPath | NULL |
#
CONTENIDO root path. Path to the folder which contains the CONTENIDO installation. |
private static
array
|
$_includeFiles | NULL |
#
Array of interface/class names with related files to include |
private static
boolean
|
$_initialized | NULL |
#
Flag containing initialized status |
private static
array
|
$_loadedClasses | array() |
#
Array to store loaded classnames and the paths to the class files. $_loadedClasses['classname'] = '/path/to/the/class.php'; |
private static
array
|
$_errors | array() |
#
Array to store invalid classnames and the paths to the class files. $_errors[pos] = array('class' => classname, 'file' => file, 'error' => errorType); |