/** * Add a classname-to-file map * * @param string $mapfile The filename of the classmap. * @param bool $prepend Whether to prepend the map to the list of maps * instead of appending it. * * @return void */ protected static function addMap($mapfile, $prepend = false) { if (!in_array($mapfile, self::$maps)) { // keep track of specific map file loaded in this // instance so we can update it if necessary self::$mapfile = $mapfile; if (is_file($mapfile)) { $map = (include $mapfile); if (is_array($map)) { // mapfile contains a valid map, so we'll keep it if ($prepend) { self::$maps = array_merge(array($mapfile), self::$maps); self::$map = array_merge($map, self::$map); } else { self::$maps[] = $mapfile; self::$map = array_merge(self::$map, $map); } } } } }