/** * 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. * * @param string $dir Directory of classes * @return \Elgg\AutoloadManager */ public function addClasses($dir) { if (!in_array($dir, $this->scannedDirs)) { $map = $this->loader->getClassMap(); $map->mergeMap($this->scanClassesDir($dir)); $this->scannedDirs[] = $dir; $this->altered = true; } $this->loader->addFallback($dir); return $this; }