/** * Remove directories from the class loader. * * @param string|array $directories * @return void */ public static function removeDirectories($directories = null) { if (is_null($directories)) { static::$directories = []; } else { static::$directories = array_diff(static::$directories, (array) $directories); } }
/** * Remove directories from the class loader. * * @param string|array $directories * @return void */ public static function removeDirectories($directories = null) { if (is_null($directories)) { static::$directories = array(); } else { $directories = (array) $directories; static::$directories = array_filter(static::$directories, function ($directory) use($directories) { return !in_array($directory, $directories); }); } }
/** * Returns the directory of the application with the given abbrevation. * * @param string $abbreviation * @return string */ public static function getDirectory($abbreviation) { if (static::$directories === null) { static::$directories = array(); // read application directories $packageList = new PackageList(); $packageList->getConditionBuilder()->add('package.isApplication = ?', array(1)); $packageList->readObjects(); foreach ($packageList as $package) { $abbr = Package::getAbbreviation($package->package); static::$directories[$abbr] = FileUtil::addTrailingSlash(FileUtil::getRealPath(WCF_DIR . $package->packageDir)); } } if (!isset(static::$directories[$abbreviation])) { throw new SystemException("Unknown application '" . $abbreviation . "'"); } return static::$directories[$abbreviation]; }
/** * Register directories to be searched as a PSR-0 library. * * @param string|array $directory * @return void */ public static function directories($directory) { $directories = static::format($directory); static::$directories = array_unique(array_merge(static::$directories, $directories)); }
public static function directory($dir) { static::$directories = array_merge(static::$directories, $dir); }
/** * Add directories to the class loader. * * @param array $directories * @return void */ public static function addDirectories(array $directories) { static::$directories = array_merge(static::$directories, $directories); static::$directories = array_unique(static::$directories); }
public static function addDirectories($directories) { static::$directories = array_unique(array_merge(static::$directories, (array) $directories)); }