ot($path); } /** * Checks if path is a base path of another path. * * @param string $basePath * @param string $path * * @return bool * * @example * Path::isBasePath('/foo/', '/foo/file.txt'); * // => true * Path::isBasePath('/foo', '/foo'); * // => true * Path::isBasePath('/foo', '/foo/..'); * // => false */ public static function isBasePath($basePath, $path) { $basePath = static::normalize(static::resolveAlias($basePath)); $path = static::normalize(static::resolveAlias($path)); return str_starts_with("{$path}/", rtrim($basePath, '/') . '/'); } /** * Returns path root. * * @param string $path * * @return mixed */ public static function root($path) { $path = strtr($path, '\\', '/'); if ($path && $path[0] === '/') { return '/'; } if (strpos($path, ':') && preg_match('/^([a-z]*:)?(\/\/|\/)/i', $path, $matches)) { return $matches[0]; } } } 0 - Class "YOOtheme\Path" not found

0

Class "YOOtheme\Path" not found

Startpagina