Get/set path for layout files.

@deprecated 3.4.0 Use setLayoutPath()/getLayoutPath() instead.
@param string|null $path Path for layout files. If null returns current path.
@return string|$this
517430
public function layoutPath($path = null)
    {
        deprecationWarning('ViewBuilder::layoutPath() is deprecated. Use ViewBuilder::setLayoutPath() or ViewBuilder::getLayoutPath() instead.');
        if ($path !== null) {
            return $this->setLayoutPath($path);
        }

        return $this->getLayoutPath();
    }
642781
private function fileRelativePath($path)
    {
        $path = $this->fileWebpath($path);
        // @todo This wont work for files not located on the current server...
        $path = str_replace_first(env('APP_URL'), '', $path);
        $path = str_replace(' ', '%20', $path);

        return $path;
    }
1317913
public function path($path = null)
    {
        if (null === $path) {
            return $this->path;
        }
        $this->path = $path;

        return $this;
    }
1361918
public function dbPath($path = null)
    {
        if (null === $path) {
            return $this->dbPath;
        }
        $this->dbPath = $path;

        return $this;
    }
949559
protected function getLayoutFile(Layout $layout)
    {
        $layoutfile = $layout->getPath();
        if (null === $layoutfile && 0 < count($this->_includeExtensions)) {
            $ext = reset($this->_includeExtensions);
            $layoutfile = StringUtils::toPath($layout->getLabel(), array('extension' => $ext));
            $layout->setPath($layoutfile);
        }

        return $layoutfile;
    }
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;
    }
1036928
protected function get_src_path( $path = '' ) {
        return rtrim( $this->get_path( $this->options->src_dir ), '/' ) .
            ( strlen( $path )  ? '/' . $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);
    }
524729
public function relPath($path = null)
    {
        # Cleaning path
        $path = preg_replace('/^\//', '', $path);

        return str_replace(public_path(), '', $this->getCurrentPath() . '/' . $path);
    }
189606
public function getTemplate($path)
    {
        if (file_exists($path)) {
            return $path;
        } elseif (false!==$path_rp = realpath($path)) {
            return $path_rp;
        } else {
            foreach ($this->getIncludePath() as $_path) {
                $_f = DirectoryHelper::slashDirname($_path).$path;
                if (file_exists($_f)) {
                    return $_f;
                }
            }
        }
        return null;
    }
342349
public function setPath($path)
    {
        if ($path) {
            $this->not_cleared_path = $path;
            $this->doClearPath();
        } else {
            $this->path = '';
        }

        return $this;
    }
272596
public function optionPath($path)
    {
        $path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);
        $path = PATH_ROOT . str_replace(PATH_ROOT, '', $path);

        if (pathinfo($path, PATHINFO_EXTENSION)) {
            $this->optionFilename(pathinfo($path, PATHINFO_FILENAME));
            $path = dirname($path);
        }

        $this->optionPath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

        return $this;
    }
381145
protected function getRelativePath($path = null)
    {
        if (!isset($path)) {
            $path = $this->scanner->getInitialPath(true);
        }

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

        return $this;
    }
78974
public function setPath(?string $path = null): ZipInterface {

        if ( $path === null ) {
            $this->path = null;
        } else if ( !file_exists($path) ) {
            throw new ZipException("Not existent path: $path");
        } else {
            $this->path = $path;
        }

        return $this;

    }
500268
private function getImagePath($path)
    {
        if ($path && file_exists($this->filesystem->getRootDir() . $path)) {
            return $path;
        }

        return $this->noImagePath;
    }
997119
public function setPath(Path $path = null)
    {
        if (!empty($this->path)) {
            $this->path->removeStep($this);
        }

        $this->path = $path;

        if (!empty($path)) {
            $path->addStep($this);
        }

        return $this;
    }