56 if (!in_array($dir, $this->scannedDirs)) {
57 $map = $this->
loader->getClassMap();
59 $this->scannedDirs[] = $dir;
60 $this->altered =
true;
62 $this->
loader->addFallback($dir);
76 $dir =
new DirectoryIterator($dir);
79 foreach ($dir as $file) {
81 if (!$file->isFile() || !$file->isReadable()) {
85 $path = $file->getRealPath();
87 if (pathinfo(
$path, PATHINFO_EXTENSION) !==
'php') {
91 $class = $file->getBasename(
'.php');
115 if ($this->storage) {
116 $map = $this->
loader->getClassMap();
117 if ($this->altered || $map->getAltered()) {
118 $spec[self::KEY_CLASSES] = $map->getMap();
120 $this->storage->save(self::FILENAME, serialize($spec));
136 $this->
loader->getClassMap()
137 ->setMap($spec[self::KEY_CLASSES])
139 $this->scannedDirs = $spec[self::KEY_SCANNED_DIRS];
142 $this->altered =
true;
153 if ($this->storage) {
154 $serialization = $this->storage->load(self::FILENAME);
155 if ($serialization) {
156 $spec = unserialize($serialization);
157 if (isset($spec[self::KEY_CLASSES])) {
171 if ($this->storage) {
172 $this->storage->delete(self::FILENAME);
loadCache()
Set the state of the manager from the cache.
addClasses($dir)
Add classes found in this directory to the class map and allow classes in subdirectories to be found ...
scanClassesDir($dir)
Scan (non-recursively) a /classes directory for PHP files to map directly to classes.
__construct(Elgg_ClassLoader $loader)
Constructor.
if(isset($vars['id'])) $class
setClassPath($class, $path)
Register the location of a class on the class map.
setStorage(ElggCache $storage)
Set the cache storage object.
deleteCache()
Delete the cache file.
saveCache()
If necessary, save necessary state details.
getSpec()
Some method that does something.
getLoader()
Get the class loader.