Get path to public directory

@return string
551641
public function getPublicDir()
    {
        $base = $this->getBaseDir();
        $public = Path::join($base, 'public') . DIRECTORY_SEPARATOR;
        if (file_exists($public)) {
            return $public;
        }
        return $base;
    }
1222560
public function getPublicUrl($path = '')
    {
        if (isset($this->options['public_url'])) return $this->options['public_url'];

        return url() . '/' . $this->addSlashes(self::DEFAULT_PUBLIC_PATH) . $path;
    }
147122
public function getDirectory()
    {
        if (!isset($this->directory)) {
            $this->setDirectory($this->getPHPCI()->buildPath);
        }
        return $this->directory;
    }
153060
public static function publicFolder()
    {
        $folder = self::baseFolder();
        $publicDir = self::publicDir();
        if ($publicDir) {
            return Path::join($folder, $publicDir);
        }

        return $folder;
    }
347645
public function getCwd()
    {
        $path = $this->wrapper->pwd();

        if ('/' === $path) {
            return new Directory('/');
        }

        return $this->findDirectoryByName($path);
    }
743358
public static function public_path(?string $file = null)
  {
    $file = (substr($file, 0, 1) == DIRECTORY_SEPARATOR ? substr($file, 1) : $file);
    return config('app.dir') . 'storage' . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . $file;
  }
1126770
public function getBasePublicPath()
    {
        $projectPath = $this->getBasePath();
        $publicPath = $this->publicPathExists()
            ? Util::joinPaths($projectPath, self::PUBLIC_PATH, self::RESOURCES_PATH)
            : Util::joinPaths($projectPath, self::RESOURCES_PATH);
        return $publicPath;
    }
121685
public function getRootDir()
    {
        static $dir;
        if (empty($dir)) {
            $rc = new \ReflectionClass(get_class($this));
            $dir = dirname(dirname($rc->getFileName()));
        }
        return $dir;
    }
1328592
public function path()
    {
        $pos = strpos($_SERVER['REQUEST_URI'], '?');

        if ($pos) {
            $uri = substr($_SERVER['REQUEST_URI'], 0, $pos);
        } else {
            $uri = $_SERVER['REQUEST_URI'];
        }

        return $uri;
    }
845628
public function getPath()
    {
        $pathInfo = rawurldecode($this->getPathInfo());
        $path = '/' . trim($pathInfo, '/');

        return ($path == '/') ? '' : $path;
    }
304848
public function getPublicPath()
    {
        if (! $this->isPubliclyAccessible()) {
            throw MediaUrlException::mediaNotPubliclyAccessible($this->getAbsolutePath(), public_path());
        }
        if ($this->isInWebroot()) {
            $path = str_replace(public_path(), '', $this->getAbsolutePath());
        } else {
            $path = rtrim($this->getPrefix(), '/').'/'.$this->media->getDiskPath();
        }

        return $this->cleanDirectorySeparators($path);
    }
1197037
function getDirFromPublicPath(file) {
	return path.posix.dirname(
		path.posix.normalize(
			path.posix.sep
			+ file.path().replace(
				new RegExp(
					'^' + escapeStringRegExp(path.resolve(Config.publicPath))
				),
				''
			).split(path.sep).join(path.posix.sep)
		)
	);
}
409601
public function getFilePath() : ?string 
    {
        if ( ! $this->hasFilePath()) {
            $this->setFilePath($this->getDefaultFilePath());
        }
        return $this->filePath;
    }
875207
public function getVendorDirectoryPath()
    {
        $path = (string) Mage::getConfig()->getNode('global/composer_autoloader/path');
        if (!$path) {
            $path = self::DEFAULT_PATH;
        }

        $path = str_replace('/', DS, $path);
        $path = str_replace('{{basedir}}', Mage::getBaseDir(), $path);
        $path = str_replace('{{libdir}}', Mage::getBaseDir('lib'), $path);
        $path = rtrim($path, DS);
        return realpath($path);
    }
1151090
public function getPath() : ?string 
    {
        if ( ! $this->hasPath()) {
            $this->setPath($this->getDefaultPath());
        }
        return $this->path;
    }
362117
public function getDirectoryPath()
    {
        $editionsPath = VENDOR_PATH . static::EDITIONS_DIRECTORY;
        $path = getShopBasePath();
        if ($this->getEditionSelector()->isEnterprise()) {
            $path = $editionsPath  .'/'. static::ENTERPRISE_DIRECTORY;
        } elseif ($this->getEditionSelector()->isProfessional()) {
            $path = $editionsPath .'/'.  static::PROFESSIONAL_DIRECTORY;
        }

        return realpath($path) . DIRECTORY_SEPARATOR;
    }
894745
private function getCookiePath()
    {
        $path = dirname(parse_url($this->getCurrentUrl(), PHP_URL_PATH));

        if ('\\' === DIRECTORY_SEPARATOR) {
            $path = str_replace('\\', '/', $path);
        }

        return $path;
    }