Manages core autoloading and caching of class maps.
More...
Manages core autoloading and caching of class maps.
Definition at line 12 of file AutoloadManager.php.
Constructor.
- Parameters
-
\Elgg\ClassLoader | $loader | Class loader object |
\Elgg\Config | $config | Config |
\Elgg\Cache\BaseCache | $cache | local file cache |
Definition at line 37 of file AutoloadManager.php.
Elgg\AutoloadManager::addClasses |
( |
|
$dir | ) |
|
Add classes found in this directory to the class map and allow classes in subdirectories to be found by PSR-0 rules.
We keep track of which dirs were scanned on previous requests so we don't need to rescan unless the cache is emptied.
- Parameters
-
string | $dir | Directory of classes |
- Returns
Definition at line 55 of file AutoloadManager.php.
Elgg\AutoloadManager::deleteCache |
( |
| ) |
|
Elgg\AutoloadManager::getCacheFileContents |
( |
| ) |
|
|
protected |
Tries to read the contents of the cache file and if valid returns the content.
- Returns
- false|array
Definition at line 160 of file AutoloadManager.php.
Elgg\AutoloadManager::getLoader |
( |
| ) |
|
Elgg\AutoloadManager::loadCache |
( |
| ) |
|
Set the state of the manager from the cache.
- Returns
- bool was the cache loaded?
Definition at line 139 of file AutoloadManager.php.
Elgg\AutoloadManager::saveCache |
( |
| ) |
|
Elgg\AutoloadManager::scanClassesDir |
( |
|
$dir | ) |
|
|
protected |
Scan (non-recursively) a /classes directory for PHP files to map directly to classes.
For BC with Elgg 1.8's autoloader we map these files directly, but besides this the autoloader is PSR-0 compatible.
- Parameters
-
string | $dir | Directory of classes |
- Returns
- array
Definition at line 77 of file AutoloadManager.php.
bool Elgg\AutoloadManager::$altered = false |
|
protected |
array Elgg\AutoloadManager::$scannedDirs = [] |
|
protected |
const Elgg\AutoloadManager::FILENAME = 'autoload_data.php' |
const Elgg\AutoloadManager::KEY_CLASSES = 'classes' |
const Elgg\AutoloadManager::KEY_SCANNED_DIRS = 'scannedDirs' |
The documentation for this class was generated from the following file: