/** * Prepend path dirs to current path * Return current path after setting * * @param array/string $path * @return array */ public static function prependPath($path) { if (is_array($path)) { while ($p = array_pop($path)) { Z::prependPath($p); } } else { $path = trim(rtrim($path, '/')); if (is_dir($path)) { array_unshift(Z::$path, "{$path}/"); } } return Z::$path; }