返回路径中的文件名，不存在则原样返回

@param string $path
@return string
968290
public static function basename($path) {
        $pos = strrpos($path, '/');
        if ($pos === false) {
            return $path;
        }
        return substr($path, $pos + 1);
    }
1130600
public function read(string $path): string
    {
        $location = $this->applyBasePath($path);
        $content  = file_get_contents($location);

        unset($location);

        return $content;
    }
1170637
protected function normalizeFilename($path)
	{
		if (file_exists($path)) {
			$path = realpath($path);
		}
		return substr($path,mb_strlen(realpath(dirname($_SERVER['DOCUMENT_ROOT']))));
	}
691290
public static function prefix(string $path = ''): string
    {
        $prefix = config('platform.prefix');

        return Str::start($prefix.$path, '/');
    }
561761
public static function getFile(string $path): string {
		$e = explode("/", rtrim($path, "/"));

		return $e[count($e) - 1];
	}
20630
public function normalizePath($path)
    {
        $path = trim($path);

        $path = str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $path);

        if (ends_with($path, DIRECTORY_SEPARATOR)) {
            $path = substr($path, 0, -1);
        }

        return $path;
    }
566975
public static function normalizePath($path)
    {
        if (is_string($path)) {
            return explode('.', $path);
        }

        if (!is_array($path)) {
            return [$path];
        }

        return $path;
    }
410155
public function readAndDelete(string $path): string
    {
        $path = $this->normalizePath($path);
        $this->assertPresent($path);
        $contents = $this->read($path);
        $this->delete($path);

        return $contents;
    }
62617
public static function stripQueryString($path)
    {
        if (($qpos = strpos($path, '?')) !== false) {
            return substr($path, 0, $qpos);
        }
        return $path;
    }
58031
protected function getPath($path)
	{
		$paths = array();

		// If `$path` is an array
		if (is_array($path))
		{
			foreach ($path as $unverifiedPath)
			{
				$paths = array_merge($paths, $this->getPath($unverifiedPath));
			}

			return $paths;
		}

		// If `$path` is a directory
		if (is_dir($path))
		{
			$paths = glob($path . '/*.*');

			return $paths;
		}

		// If `$path` is a file
		if (file_exists($path))
		{
			$paths[] = $path;
		}

		return $paths;
	}
1096154
public function getRealPath($path)
    {
        // 得到确定的path
        $path = $this->getPathFromUrl($path);
        $path = $this->safePath($path);
        $path = "{$this->storageDir}{$path}";
        
        return $path;
    }
1173086
private function normalizePath($path)
    {
        $path = rtrim($path, '/');

        if (empty($path) or '/' !== substr($path, 0, 1)) {
            $path = '/';
        }

        return $path;
    }
1329812
protected function normalize_path( $path ) {

		$path = str_replace( '\\', '/', $path );
		$path = preg_replace( '|/+|','/', $path );

		return rtrim( $path, '/' );
	}
541819
protected function safePath($path)
    {
        $safePath = '';
        if (dirname($path) !== '.') {
            $safePath = str_replace('../', '', dirname($path)) . '/';
        }
        return $safePath;
    }
100354
protected static function getFilename(string $path): string
    {
        $parts = pathinfo(urldecode($path));
        $path = isset($parts['dirname']) ? $parts['dirname'] : '';
        $filename = isset($parts['basename']) ? $parts['basename'] : '';

        //if has not extension, assume it's a directory and append index.html
        if (empty($parts['extension'])) {
            $filename .= '/index.html';
        }

        return str_replace('//', '/', $path.'/'.$filename);
    }
188526
public static function removeFileName($path)
    {
        $parts = explode(DIRECTORY_SEPARATOR, static::normalizePath($path));

        array_pop($parts);

        return implode(DIRECTORY_SEPARATOR, $parts);
    }
47703
public static function detectByFilePath(string $path): string
    {
        $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION));

        return empty($extension) ? 'text/plain' : static::detectByFileExtension($extension);
    }