addClassmapConfig(array $config) : void
NOTE: Since this autoloader is implemented for CONTENIDO, it doesn't support to load classfiles being located outside of the CONTENIDO installation folder.
array
Assoziative class map array as follows:
// Structure is: "Classname" => "Path to classfile from CONTENIDO installation folder" $config = array( 'myPluginsClass' => 'contenido/plugins/myplugin/classes/class.myPluginClass.php', 'myPluginsOtherClass' => 'contenido/plugins/myplugin/classes/class.myPluginsOtherClass.php', );
addClassmapConfigFile(string $configFile) : void
NOTE: Since this autoloader is implemented for CONTENIDO, it doesn't support to load classfiles being located outside of the CONTENIDO installation folder.
string
Full path to class map configuration file. The provided file must return a class map configuration array as follows:
// Structure is: "Classname" => "Path to classfile from CONTENIDO installation folder" return array( 'myPluginsClass' => 'contenido/plugins/myplugin/classes/class.myPluginClass.php', 'myPluginsOtherClass' => 'contenido/plugins/myplugin/classes/class.myPluginsOtherClass.php', 'myCmsClass' => 'cms/includes/class.myCmsClass.php', );
autoload(string $className) : void
Tries to include the file of passed classname.
string
The classname
\cBadMethodCallException |
If autoloader wasn't initialized before |
---|
getErrors() : array
array
getLoadedClasses() : array
array
initialize(array $cfg) : void
Registers itself as a __autoload implementation, includes the class map file, and if exists, the user defined class map file, containing the includes.
array
The CONTENIDO cfg array
isAutoloadable(string $file) : bool
string
Filename or Filename with a part of the path, e. g. - class.foobar.php - classes/class.foobar.php - contenido/classes/class.foobar.php
bool
_getContenidoClassFile(string $className) : \(string | \null)
string
\(string
\null)
Path and filename or null_loadFile(string $filePathName, bool $beQuiet) : void
string
bool
Flag to prevent thrown warnings/errors by using the error control operator @
_normalizeConfig(array $config) : array
This prevents errors by trying to load class 'foobar' if the real class name is 'FooBar'.
array
array
_validateClassAndFile(string $className, string $filePathName) : \(string | \null)
string
string
\(string
\null)
The file if validation was successfull, otherwhise null$_conRootPath : string
Path to the folder which contains the CONTENIDO installation.
$_errors : array
$_errors[pos] = array('class' => classname, 'file' => file, 'error' => errorType);
$_includeFiles : array
$_initialized : bool
$_loadedClasses : array
$_loadedClasses['classname'] = '/path/to/the/class.php';
ERROR_CLASS_EXISTS
ERROR_FILE_NOT_FOUND