\rex_autoload

REDAXO Autoloader.

This class was originally copied from the Symfony Framework: Fabien Potencier fabien.potencier@symfony-project.com

Adjusted in very many places

Summary

Methods
Properties
Constants
register()
unregister()
autoload()
saveCache()
reload()
removeCache()
addDirectory()
getClasses()
No public properties found
No constants found
No protected methods found
$composerLoader
$registered
$cacheFile
$cacheChanged
$cacheDeleted
$reloaded
$dirs
$addedDirs
$classes
N/A
No private methods found
No private properties found
N/A

Properties

$composerLoader

$composerLoader : \Composer\Autoload\ClassLoader

Type

\Composer\Autoload\ClassLoader —

$registered

$registered : bool

Type

bool

$cacheFile

$cacheFile : null|string

Type

null|string

$cacheChanged

$cacheChanged : bool

Type

bool

$cacheDeleted

$cacheDeleted : bool

Type

bool — remember the cache was deleted, to make sure we don't generate a stale cache file

$reloaded

$reloaded : bool

Type

bool

$addedDirs

$addedDirs : string[]

Type

string[]

$classes

$classes : string[]

Type

string[]

Methods

register()

register() : mixed

Register rex_autoload in spl autoloader.

Returns

mixed —

unregister()

unregister() : mixed

Unregister rex_autoload from spl autoloader.

Returns

mixed —

autoload()

autoload(string  $class) : bool

Handles autoloading of classes.

Parameters

string $class

A class name

Returns

bool —

Returns true if the class has been loaded

saveCache()

saveCache() : mixed

Saves the cache.

Returns

mixed —

reload()

reload(bool  $force = false) : mixed

Reanalyses all added directories.

Parameters

bool $force

If true, all files are reanalysed, otherwise only new and changed files

Returns

mixed —

removeCache()

removeCache() : mixed

Removes the cache.

Returns

mixed —

addDirectory()

addDirectory(string  $dir) : mixed

Adds a directory to the autoloading system if not yet present.

Parameters

string $dir

The directory to look for classes

Returns

mixed —

getClasses()

getClasses() : string[]

Returns the classes.

Returns

string[] —