Checks whether the specified path is relative or not.

@param bool $path Path to check.

@return bool
764218
public static function isRelativePath($path) {
        if ($path[0] == '~' || $path[0] == '.') {
            return true;
        }

        if ($path[0] == '/' && !is_file($path) && !is_dir($path)) {
            return true;
        }

        return false;
    }
1255827
public static function check($path)
	{
		if (strpos($path, '..') !== false)
		{
			throw new FilesystemException(
				sprintf(
					'%s() - Use of relative paths not permitted',
					__METHOD__
				),
				20
			);
		}

		$path = static::clean($path);

		if ((JPATH_ROOT != '') && strpos($path, static::clean(JPATH_ROOT)) !== 0)
		{
			throw new FilesystemException(
				sprintf(
					'%1$s() - Snooping out of bounds @ %2$s',
					__METHOD__,
					$path
				),
				20
			);
		}

		return $path;
	}
255019
public function folderExists($path)
    {
        $folderName = basename($path);
        $folderPath = dirname($path);

        $path = self::validatePath($folderPath);
        $fullPath = $this->getMediaPath($path);

        $folders = $this->getStorageDisk()->directories($fullPath);
        foreach ($folders as $folder) {
            if (basename($folder) == $folderName) {
                return true;
            }
        }

        return false;
    }
1017277
protected static function isValidPath($path)
    {
        if (strpos($path, '?') !== false) {
            return false;
        }
        if (strpos($path, '*') !== false) {
            return false;
        }
        if (strpos($path, ':') !== false) {
            return false;
        }
        if (strpos($path, '|') !== false) {
            return false;
        }
        if (strpos($path, '\\') !== false) {
            return false;
        }
        if (strpos($path, '<') !== false) {
            return false;
        }
        if (strpos($path, '>') !== false) {
            return false;
        }
        if (strpos($path, '"') !== false) {
            return false;
        }

        return true;
    }
1016454
public static function isAbsolutePath($path) : bool
    {
        /*
         * This is definitive if true but fails if $path does not exist or contains
         * a symbolic link.
         */
        if (realpath($path) == $path) {
            return true;
        }

        if (strlen($path) == 0 || $path[0] == '.') {
            return false;
        }

        // Windows allows absolute paths like this.
        if (preg_match('#^[a-zA-Z]:\\\\#', $path)) {
            return true;
        }

        // A path starting with / or \ is absolute; anything else is relative.
        return ( $path[0] == '/' || $path[0] == '\\' );
    }
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;
	}
1027964
public function have($path)
    {
        $keys  = $this->explode($path);
        $array = $this->values;
        foreach ($keys as $key) {
            if (isset($array[$key])) {
                $array = $array[$key];
            } else {
                return false;
            }
        }

        return true;
    }
829500
protected function checkPath($path) {
		if (is_dir($path)) {
			return true;
		}

		if (mkdir($path, 0755, true)) {
			return true;
		} else {
			$this->error = "目录 {$path} 创建失败！";
			return false;
		}
	}
1318455
public function has($path)
    {
        try {
            $this->api->resource($path);
        } catch (Exception $e) {
            return false;
        }

        return true;
    }
89666
public function has($path)
    {
        $location = $this->applyPathPrefix($path);

        if ($this->s3Client->doesObjectExist($this->bucket, $location, $this->options)) {
            return true;
        }

        return $this->doesDirectoryExist($location);
    }
671326
protected function is_valid_path($path)
	{
		if(strpos($path, $this->rootWrapperPath) !== 0) {
			return false;
		}

		$needleList = ['..', './'];
		foreach($needleList as $needle) {
			if (strpos($path, $needle) !== false) {
				return false;
			}
		}

		return true;
	}
669931
public static function isAbsolutePath($path)
    {
        if (isset($path[0]) and ($path[0] == '/' or $path[0] == '\\')) {
            return true;
        }
        if (preg_match('/^[A-Za-z0-9]+:/', $path) === 1) {
            return true;
        }
        return false;
    }
14582
public static function isDir($path)
    {
        return (self::isPhar($path) === true) ? file_exists($path) : is_dir($path);
    }
365293
public function isdir( $path )
	{
		return in_array( basename( $path ), $this->fs->directories( dirname( $path ) ) );
	}
1342256
public function has($path)
    {
        $location = $this->applyPathPrefix($path);

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

        return true;
    }
776002
public function exists($path, $public = true)
    {
        $path = $this->_relativepath($path, $public);

        return $this->_exists($path);
    }
1353103
public function is($path)
    {
        list($package, $route) = $this->locate($path);

        return $this->route($package)->is($route);
    }