判断指定路径是否是需要忽略解码的路径
使用配置文件router中的_ignore配置数组

@param string $path URI 去除了 协议,端口,站点,以首个/
@return boolean
10739
static public function ignore(string $path): bool
    {
        // 取配置
        $all = configDefault(false,'router', '_ignore');

        // 如果没有配置,或为空
        if (!$all) {
            return false;
        }

        // 逐个配置查看
        foreach ($all as $case) {
            // 是否正则匹配
            if (preg_match($case, $path)) {
                return true;
            }
        }

        // 没有能匹配的
        return false;
    }
387671
public function checksumByPath(string $path)
    {
        return file_exists($path) ? $this->checksum((string) file_get_contents($path)) : null;
    }
1336945
public function deleteDir($path)
    {
        $this->deleteContents($path);

        $location = $this->applyPathPrefix($path);

        try {
            $this->share->rmdir($location);
        } catch (NotFoundException $e) {
            return false;
        } catch (InvalidTypeException $e) {
            return false;
        }

        return true;
    }
927337
public function matchesPath($path)
    {
        if ($this->_data['path'] === '/' || $this->_data['path'] === $path) {
            return true;
        }

        if (strpos($path, $this->_data['path']) !== 0) {
            return false;
        }

        if (substr($this->_data['path'], -1, 1) === '/') {
            return true;
        }

        return substr($path, strlen($this->_data['path']), 1) === '/';
    }
1275619
private function createPathIfNeeded(string $path) : bool
    {
        if (! is_dir($path)) {
            if (@mkdir($path, 0777 & (~$this->umask), true) === false && ! is_dir($path)) {
                return false;
            }
        }

        return true;
    }
5891
public static function isAbsolute($path)
    {
        if (($position = strpos($path, './')) !== false && $position <= 2) {
            return false;
        }
        if (strpos($path, ':') !== false) {
            return true;
        }
        if (substr($path, 0, 1) === '/') {
            return true;
        }
        return false;
    }
624233
public function unlink($path)
    {
        $stream = $this->createStream($path);

        try {
            $stream->open($this->createStreamMode('w+'));
        } catch (\RuntimeException $e) {
            return false;
        }

        return $stream->unlink();
    }
662619
public function getRealPath($path)
    {
        // 得到确定的path
        $path = $this->getPathFromUrl($path);
        $path = $this->safePath($path);
        
        // *nux系统上不存在的文件realpath() = false，因此先去存贮目录的真实路径
        $path = realpath($this->storageDir) . '/' . $path;
        
        return $path;
    }
1118116
public function removeDir($path)
    {
        if ($path == 'packages' or $path == '/') {
            return false;
        }

        $files = array_diff(scandir($path), ['.', '..']);
        foreach ($files as $file) {
            if (is_dir("$path/$file")) {
                $this->removeDir("$path/$file");
            } else {
                @chmod("$path/$file", 0777);
                @unlink("$path/$file");
            }

        }
        return rmdir($path);
    }
425595
public function check_path($path = '')
	{
		if ($path === '')
		{
			if ($this->db->cachedir === '')
			{
				return $this->db->cache_off();
			}

			$path = $this->db->cachedir;
		}

		// Add a trailing slash to the path if needed
		$path = realpath($path)
			? rtrim(realpath($path), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR
			: rtrim($path, '/').'/';

		if ( ! is_dir($path))
		{


			// If the path is wrong we'll turn off caching
			return $this->db->cache_off();
		}

		if ( ! is_really_writable($path))
		{

			// If the path is not really writable we'll turn off caching
			return $this->db->cache_off();
		}

		$this->db->cachedir = $path;
		return TRUE;
	}
369184
protected function checkPath($path)
    {
        foreach ($this->chroots as $chroot) {
            if (StringHelper::contains($path, $chroot)) {
                return true;
            }
        }
        return false;
    }
1349403
private static function removeDirectoryRecursive($path) : bool
    {
        if ( !file_exists($path) ){
            return true;
        }

        $handle = opendir("$path");
        if ( $handle === FALSE ) {
            return false;
        }
        while ( false !== ($item = readdir($handle)) ) {
            if ($item != "." && $item != "..") {
                if (is_dir("$path/$item")) {
                    $res = self::removeDirectoryRecursive( "$path/$item" );
                    if (!$res){
                        return false;
                    }
                } else {
                    $res = @unlink( "$path/$item" );
                    if (!$res){
                        return false;
                    }
                }
            }
        }
        closedir( $handle );
        return @rmdir($path);
    }
1134637
public function delete($path)
    {
        try {
            $response = $this->api->deleteResources([$path]);

            return $response['deleted'][$path] === 'deleted';
        } catch (Api\Error $e) {
            return false;
        }
    }
729560
protected static function tryDelete($path)
    {
        $success = true;

        try
        {
            if ( ! @unlink($path))
            {
                $success = false;
            }
        } catch (ErrorException $e)
        {
            $success = false;
        }

        return $success;
    }
179590
public static function delete($path)
	{
		if (is_dir($path)) {
			Dir::delete($path);
		} elseif (is_file($path)) {
			File::delete($path);
		}

		return true;
	}
639454
public static function removePath($path)
    {
        $result = false;

        $path = realpath($path);
        if ($path) {
            self::remove($path);
            $result = true;
        }

        return $result;
    }
1179252
public function matchesPath($path)
    {
        // RFC6265 http://tools.ietf.org/search/rfc6265#section-5.1.4
        // A request-path path-matches a given cookie-path if at least one of
        // the following conditions holds:

        // o  The cookie-path and the request-path are identical.
        if ($path == $this->getPath()) {
            return true;
        }

        $pos = stripos($path, $this->getPath());
        if ($pos === 0) {
            // o  The cookie-path is a prefix of the request-path, and the last
            // character of the cookie-path is %x2F ("/").
            if (substr($this->getPath(), -1, 1) === "/") {
                return true;
            }

            // o  The cookie-path is a prefix of the request-path, and the first
            // character of the request-path that is not included in the cookie-
            // path is a %x2F ("/") character.
            if (substr($path, strlen($this->getPath()), 1) === "/") {
                return true;
            }
        }

        return false;
    }