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.
arrayAssoziative 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.
stringFull 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.
stringThe classname
\cBadMethodCallException |
If autoloader wasn't initialized before |
|---|
getErrors() : array
arraygetLoadedClasses() : array
arrayinitialize(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.
arrayThe CONTENIDO cfg array
isAutoloadable(string $file) : bool
stringFilename 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
boolFlag 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