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