Set the root path to use in the path methods.

@param int|string $path Either one of the PATH class constants or an actual path to a directory that exists, and is readable

@return void
325114
public static function usePath($path)
    {
        # Use the document root normally set via apache
        if ($path === self::PATH_DOCUMENT_ROOT) {
            if (empty($_SERVER["DOCUMENT_ROOT"]) || !is_dir($_SERVER["DOCUMENT_ROOT"])) {
                throw new \InvalidArgumentException("DOCUMENT_ROOT not defined");
            }
            static::$path = $_SERVER["DOCUMENT_ROOT"];
            return;
        }

        # Get the full path of the running script and use it's directory
        if ($path === self::PATH_PHP_SELF) {
            if (empty($_SERVER["PHP_SELF"]) || !$path = realpath($_SERVER["PHP_SELF"])) {
                throw new \InvalidArgumentException("PHP_SELF not defined");
            }
            static::$path = pathinfo($path, PATHINFO_DIRNAME);
            return;
        }

        # Calculate the parent of the vendor directory and use that
        if ($path === self::PATH_VENDOR_PARENT) {
            static::$path = realpath(__DIR__ . "/../../../..");
            return;
        }

        if (is_dir($path)) {
            static::$path = $path;
        } else {
            throw new \InvalidArgumentException("Invalid path specified");
        }
    }
342349
public function setPath($path)
    {
        if ($path) {
            $this->not_cleared_path = $path;
            $this->doClearPath();
        } else {
            $this->path = '';
        }

        return $this;
    }
20443
protected function realSetPath($path, $relative)
    {
        if (!is_string($path) || !$this->validatePath($path, $relative)) {
            throw new \InvalidArgumentException(
                'Invalid path; use relative() for relative paths'
            );
        }
        $this->path = $path;
    }
1182138
public static function addPath($path)
    {
        $path = str_replace('//', '/', rtrim($path, '/'));
        if (is_dir($path) && !in_array($path, self::$_paths)) {
            array_unshift(self::$_paths, $path);
        }
    }
1287354
public function setPath($path)
    {
        if (!$this->databaseIsPath) {
            $path = ltrim($path, '/');
        }
        $this->setDatabase($path);
    }
32586
public function setPath($path = null)
    {
        if (is_string($path)) {
            if ($path{0} !== '/') {
                $path = "/$path";
            }
        }
        else if (!is_null($path)) {
            throw new \InvalidArgumentException(
                "invalid value provided for 'path'; ".
                " expecting a string or null"
            );
        }
        $this->path = $path;
    }
1194479
public function setPath($path)
    {
        if (!is_string($path)) {
            $path = $this->app->url($path);
        }
        $this->path = $path.'#';

        return $this;
    }
29151
public function setPath($path)
    {
        if ($this->isReference()) {
            throw $this->tooManyAttributes();
        }
        $this->createPathElement()->setPath($path);
    }
1202991
public function setPath( $path )
	{
#		if( $path && !file_exists( $path ) )
#			throw new RuntimeException( 'Invalid path' );
		$path	= str_replace( DIRECTORY_SEPARATOR, "/", $path );
		$path	= preg_replace( "@(.+)/$@", "\\1", $path )."/";
		$this->path	= $path;
	}
323325
public function setDocumentRoot($path)
    {
        if (file_exists($path)) {
            $this->document_root = realpath($path);
        } elseif (file_exists(DirectoryHelper::slashDirname($this->getRootDirectory()) . $path)) {
            $this->document_root = DirectoryHelper::slashDirname($this->getRootDirectory()) . $path;
        } else {
            throw new \InvalidArgumentException(
                sprintf('Document root path "%s" doesn\'t exist!', $path)
            );
        }
        return $this;
    }
911370
public function setConnectionRoot($path = '')
    {
        $basePath = $path ?: $this->config['root'];

        if ($basePath && (!ftp_chdir($this->connection, $basePath))) {
            throw new RuntimeException('Root is invalid or does not exist: ' . $basePath);
        }

        // Store absolute path for further reference.
        $this->base_directory = ftp_pwd($this->connection);
    }
353690
public function setPath(string $path): self
    {
        $realpath = realpath($path);
        if ($path && $path === $realpath) {
            $this->path = $path . DIRECTORY_SEPARATOR;
        }

        return $this;
    }
1068061
public function setPath($path)
    {
        if (is_string($path)) {
            $array = explode('/', $path);
        } else if (is_array($path)) {
            $array = $path;
            $path = implode('/', $path);
        }

        return $this
            ->setDot('path.string', $path)
            ->setDot('path.array', $array);
    }
1041844
public function setPath($path)
    {
        if (!file_exists($path))
        {
            mkdir($path, 0777, true);
        }

        $this->path = $path;
    }
1215023
public function setPath(string $path = ''): void
    {
        $this->path = '/';
        if ($path != '') {
            $this->path .= \substr($path, 0, 1) === '/' ? \substr($path, 1) : $path;
        }
    }
173654
protected function setSourcePath($path)
    {
        if ($this->sourcePath === self::BASE_PATH) {
            $this->sourcePath = $path;
        } elseif ($this->sourcePath === self::EMPTY_PATH) {
            $this->sourcePath = null;
        }
    }
478538
public function setBasePath($path) {
		$path = realpath($path);
		
		if ($path === false) {
			throw new NoPath('Path does not exists or is not accessible');
		}
		
		$this->basePath = rtrim($path, DIRECTORY_SEPARATOR);
		
		return $this;
	}