Sets the path of the URI

@param string $path The path
@return void
@throws \InvalidArgumentException
@deprecated Since Flow 5.1, use withPath instead
@see withPath()
965962
public function setPath($path)
    {
        if (preg_match(self::PATTERN_MATCH_PATH, $path) !== 1) {
            throw new \InvalidArgumentException('"' . $path . '" is not valid path as part of a URI.', 1184071242);
        }

        $this->path = $path;
    }
173654
protected function setSourcePath($path)
    {
        if ($this->sourcePath === self::BASE_PATH) {
            $this->sourcePath = $path;
        } elseif ($this->sourcePath === self::EMPTY_PATH) {
            $this->sourcePath = null;
        }
    }
1082216
public function setAssetsDirectory($path)
    {
        $realpath = $this->getFullPath($path, null, true);
        if (@file_exists($realpath) && is_dir($realpath)) {
            $this->_assets_dir = $path;
        } else {
            throw new InvalidArgumentException(
                sprintf('Assets directory "%s" not found !', $path)
            );
        }
        return $this;
    }
644826
public function setBasePath($path)
    {
        if (!is_string($path)) {
            throw new InvalidArgumentException(
                'Path must be a string'
            );
        }

        // Can not be empty
        if ($path == '') {
            throw new InvalidArgumentException(
                'Path can not be empty'
            );
        }

        $this->basePath = $path;
        return $this;
    }
277193
private function setPath($path)
    {
        $this->info['path'] = $this->info['file'] = $this->info['extension'] = $this->info['content'] = null;

        if ($this->getScheme() === 'data') {
            $this->info['content'] = $path;

            return;
        }

        $file = substr(strrchr($path, '/'), 1);

        if (strlen($file)) {
            $path = substr($path, 0, -strlen($file));

            if (preg_match('/(.*)\.([\w]+)$/', $file, $match)) {
                $this->info['file'] = rawurldecode($match[1]);
                $this->info['extension'] = $match[2];
            } else {
                $this->info['file'] = rawurldecode($file);
            }
        }

        $this->info['path'] = [];

        foreach (explode('/', $path) as $dir) {
            $dir = rawurldecode($dir);

            if ($dir !== '') {
                $this->info['path'][] = $dir;
            }
        }
    }
1287354
public function setPath($path)
    {
        if (!$this->databaseIsPath) {
            $path = ltrim($path, '/');
        }
        $this->setDatabase($path);
    }
498336
public function setPath(string $path)
    {
        $this->path = $path;
        
        // update path to templates and preload list of templates.
        $this->contentPath = $this->path . DIR_CONTENT_BASENAME;
        $this->templatesPath = $this->contentPath . DIR_TEMPLATES_BASENAME;
        
        $this->templates = File::listFilesRecursively($this->templatesPath, false, EXT_PART, EXT_PAGE);
    }
160831
public function setLogDirectory(?string $path): self
    {
        if (null !== $path) {
            if (!is_dir($path)) {
                throw new InvalidArgumentException(sprintf(
                    "Tracy log path '%s' does`t exists",
                    $path
                ));
            }

            $path = realpath($path);
        }

        $this->logDirectory = $path;
        return $this;
    }
263320
public function setPath($path)
    {
        $uri = $this->guzzleRequest->getUri()->withPath($path);
        $this->guzzleRequest = new Request($this->guzzleRequest->getMethod(), $uri);
    }
590763
public function setPath($path)
    {
        $parts = explode(DS, $path);
        $filename = array_pop($parts);

        // with format.
        if (preg_match('/^(.+?)\.(.+)$/', $filename, $matches)) {
            $filename = $matches[1];
            $format = $matches[2];
            $parts[] = $filename;
            $this->path = join(DS, $parts);
            $this->setParam('format', $format);

        // no format
        } else {
            $this->path = $path;
        }
    }
944175
public function setRuntimePath($path)
    {
        $this->_runtimePath = $this->getAlias($path);
        $this->setAlias('@runtime', $this->_runtimePath);
    }
443484
public function setPath($path)
    {
        if (!file_exists($path) || !is_dir($path)) {
            throw new \InvalidArgumentException(
                'Expected the template path to be an existing directory, received: '.$path
            );
        }

        $this->path = $path;
    }
109035
public function setPath(string $path)
    {
        $path = '/' . ltrim($path, '/');
        $this->query = null;
        $this->fragment = null;
        if (preg_match('/^(.*?)(\\?([^#]*))?(#(.*))?$/u', $path, $matches))
        {
            $path = $matches[1];
            $this->query = !empty($matches[3]) ? $matches[3] : null;
            $this->fragment = !empty($matches[5]) ? $matches[5] : null;
        }

        $this->path = $path;
        return $this;
    }
827467
public function setPath($path)
	{
		$path = trim($path, '/');

		if (strlen($path) > 0)
		{
			$this->_path = '/' . $path . '/';
		}
		else
		{
			$this->_path = '/';
		}

		if ($this->_urlsInited)
		{
			$this->_initUrls();
		}
	}
885388
public function setPath(string $path = null)
    {
        if ($path === null) {
            $uri = $this->server->get('REQUEST_URI');

            if (empty($uri)) {
                // Default to a slash
                $this->path = '/';
            } else {
                $uriParts = explode('?', $uri);
                $this->path = $uriParts[0];
            }
        } else {
            $this->path = $path;
        }
    }
836675
public function setRelativePath($path)
	{
		if ( ! is_string($path))
		{
			throw new \InvalidArgumentException('Относительный путь к ресурсу должен быть строкового типа.');
		}

		$this->isModified = true;
		$this->parameters['path'] = '/'.ltrim($path, ' /');

		return $this;
	}
499763
public function set($path)
	{
		if (! is_string($path)) {
			throw new \InvalidArgumentException();
		}
		if ($path === '') {
			$this->setParts([]);
		} else {
			$this->setParts(explode('/', $path));
		}
		return $this;
	}