Set the document root directory

@param   string  $path   The path of the document root directory
@return  self
@throws  \InvalidArgumentException if the directory was not found
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;
    }
7017
public function setVendorDirectory($path)
    {
        $realpath = $this->getFullPath($path, null, true);
        if (@file_exists($realpath) && is_dir($realpath)) {
            $this->_vendor_dir = $path;
        } else {
            throw new InvalidArgumentException(
                sprintf('Vendor directory "%s" not found !', $path)
            );
        }
        return $this;
    }
456483
public static function setRootPath(string $root)
    {
        $mode = static::mode();
        $path = "{$root}/{$mode}";

        if (! file_exists($path)) {
            throw new InvalidArgumentException("'{$path}' not exists");
        }

        static::$root = realpath($root);
        static::$path = realpath($path);

        unset($mode, $path);
    }
1242046
public function setRootAndPath(Document $root, $path)
    {
        Archive::set($this, 'root_and_path', array('root' => $root, 'path' => $path));

        if (isset($this->data['embeddedsOne'])) {
            foreach ($this->data['embeddedsOne'] as $name => $embedded) {
                $embedded->setRootAndPath($root, $path.'.'.$name);
            }
        }

        if (isset($this->data['embeddedsMany'])) {
            foreach ($this->data['embeddedsMany'] as $name => $embedded) {
                $embedded->setRootAndPath($root, $path.'.'.$name);
            }
        }
    }
39268
protected function setDocumentRoot(FilePathInterface $documentRoot): void
    {
        if (!$documentRoot->isDirectory()) {
            throw new InvalidFilePathException('Document root "' . $documentRoot . '" is not a directory.');
        }

        if (!$documentRoot->isAbsolute()) {
            throw new InvalidFilePathException('Document root "' . $documentRoot . '" is not an absolute path.');
        }

        $this->documentRoot = $documentRoot;
    }
856512
public function logDir(string $path): self
    {
        $this->validatePathIsRelativeToProject($path, __METHOD__);
        $this->logDir = rtrim($path, '/');

        return $this;
    }
925251
public function setPath($path)
    {
        $this->path = $path;
        $fileFullPath = "{$this->rootPath}/{$this->path}";
        // readable ?
        if (file_exists($fileFullPath)) {
            $this->file = $fileFullPath;
            return $this;
        }
        // absolute path ?
        if (file_exists($path) && strpos($path, $this->rootPath) === 0) {
            $this->file = $path;
            $this->rootPath = '/';
        } else {
            error_log("[BEAR.Ace] 404: {$fileFullPath}");
            throw new Exception('Not found ' . $fileFullPath, 404);
        }

        return $this;
    }
1133176
public function setPath($path = '')
    {
        $userFolder = Str::normalizePath(config('cripfilesys.user_folder'));

        if ($userFolder !== '' && !starts_with($path, $userFolder)) {
            $path = empty($path) ? '' : $path;
            $path = $this->prefixPath($path, $userFolder);
        }

        $this->path = Str::normalizePath($path);

        return $this;
    }
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;
    }
109067
public function setBasePath($path) {
		$path = rtrim($path, '\/');
		
		if (preg_match('~^[a-z]+:~', $path)) {
			$this->basePath = $path;
			return;
		}
		
		$this->basePath = realpath($path);
		
		return $this;
	}
305532
public function setFilePath($path) {
		$path = realpath($path);
		
		if ($path === false) {
			throw new NoPath('Invalid path: ' . $path);
		}
		
		$this->path = $path;
		
		return $this;
	}
875965
public function setRelativeAssetsPath($path) {

	    $path = trim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/');

	    if($path) {
	        $path .= '/';
        }

		$this->relativeAssetsPath =  $path;
		return $this;

	}
771050
public function setBasePath($path) {
		$path = rtrim($path, '\/');
		
		if (preg_match('~^[a-z]+:~', $path)) {
			$this->basePath = $path;
			$this->isLocal  = false;
			return;
		}
		
		$this->basePath = realpath($path);
		$this->isLocal  = true;
		
		return $this;
	}
439766
protected function _setCurrentPath($path)
    {
        if ($this->_skipRoot && is_dir($path)) {
            $this->_currentPath = $path.(substr($path, -1)!=DS?DS:'');
        } else {
            $this->_currentPath = dirname($path) . DS;
        }
        return $this;
    }
266556
public function setPath(string $path): void
    {
        if (!file_exists($path) || !is_dir($path)) {
            throw new InvalidArgumentException(
                'Expected the template path to be an existing directory, received: ' . $path
            );
        }

        $this->path = $path;
    }
501780
public function setPath($path)
    {
        if(empty($path)) {
            $this->_path = '/';
        } else {
            $this->_path = $path;
        }

        return $this;
    }
954689
public function setCachePath($path)
    {
        if (@file_exists($path) && is_dir($path)) {
            $this->cache_path = realpath($path).'/';
        } elseif (null!==$path_rp = $this->findRealPath($path)) {
            $this->cache_path = rtrim($path_rp, '/').'/';
        } else {
            throw new \InvalidArgumentException(
                sprintf('Cache path "%s" was not found or is not a directory!', $path)
            );
        }
        return $this;
    }