Get the URL to the Flarum installation.

@param string $path
@return string
549059
public function url($path = null)
    {
        $config = $this->make('flarum.config');
        $url = array_get($config, 'url', array_get($_SERVER, 'REQUEST_URI'));

        if (is_array($url)) {
            if (isset($url[$path])) {
                return $url[$path];
            }

            $url = $url['base'];
        }

        if ($path) {
            $url .= '/'.array_get($config, "paths.$path", $path);
        }

        return $url;
    }
387895
protected function buildUrl($path)
    {
        $path = str_replace('%2F', '/', $path);
        $path = str_replace(' ', '%20', $path);

        return rtrim($this->base, '/') . '/' . $path;
    }
207807
public function url($path = null)
    {
        $routeAction = 'Cms\Classes\CmsController@run';

        if (self::$actionExists === null) {
            self::$actionExists = Route::getRoutes()->getByAction($routeAction) !== null;
        }

        if (substr($path, 0, 1) == '/') {
            $path = substr($path, 1);
        }

        if (self::$actionExists) {
            return Url::action($routeAction, ['slug' => $path]);
        }

        return Url::to($path);
    }
1220375
protected function getPath($path)
    {
        $pathsFile = __DIR__.'/../../../../../config/rinvex.composable.php';
        $paths = file_exists($pathsFile) ? require $pathsFile : [];

        return $paths[$path] ?? __DIR__.$this->paths[$path];
    }
75989
public function getUrlForRelativePath($path)
    {
        return $this->getUrlForPath(
            $this->_joinPathComponents($this->getPath(), ltrim($path, '/')));
    }
924192
public function objectUrl($path)
    {
        if (URL::isValidUrl($path)) {
            return $path;
        }

        return Storage::disk(config('admin.upload.disk'))->url($path);
    }
363658
protected function getLocalUrl($path)
    {
        $config = $this->driver->getConfig();

        // If an explicit base URL has been set on the disk configuration then we will use
        // it as the base URL instead of the default path. This allows the developer to
        // have full control over the base path for this filesystem's generated URLs.
        if ($config->has('url')) {
            return $this->concatPathToUrl($config->get('url'), $path);
        }

        $path = '/storage/'.$path;

        // If the path contains "storage/public", it probably means the developer is using
        // the default disk to generate the path instead of the "public" disk like they
        // are really supposed to use. We will remove the public from this path here.
        if (Str::contains($path, '/storage/public/')) {
            return Str::replaceFirst('/public/', '/', $path);
        }

        return $path;
    }
1205233
public function getPathUrl($path)
    {
        $path = $this->validatePath($path);

        $fullPath = $this->storagePath.implode("/", array_map("rawurlencode", explode("/", $path)));

        return Url::to($fullPath);
    }
1247581
public static function getImageUrl($path)
    {
        $disk = config('filesystems.default');
        #Log::debug(__CLASS__ . ':' . __TRAIT__ . ':' . __FILE__ . ':' . __LINE__ . ':' . __FUNCTION__ . ':' .
        #    'Get Image URL for path = ' . $path);

        /** @var \Illuminate\Filesystem\FilesystemAdapter $storage */
        $storage = Storage::disk($disk);

        // Check that the path is valid
        if (! $storage->exists($path)) {
            return '';
        }

        #Log::debug(__CLASS__ . ':' . __TRAIT__ . ':' . __FILE__ . ':' . __LINE__ . ':' . __FUNCTION__ . ':' .
        #    'Filesystem driver = ' . $disk);
        switch ($disk) {
            case 's3':
                /** @var Filesystem $driver */
                $driver = $storage->getDriver();

                /** @var AwsS3Adapter $adapter */
                $adapter = $driver->getAdapter();

                /** @var S3Client $client */
                $client = $adapter->getClient();
                $bucket = config('filesystems.disks.s3.bucket');
                $url    = $client->getObjectUrl($bucket, $path);
                #Log::debug(__CLASS__ . ':' . __TRAIT__ . ':' . __FILE__ . ':' . __LINE__ . ':' . __FUNCTION__ . ':' .
                #    'URL = ' . $url);
                return $url;
                break;

            case 'local':
                return config('url') . '/' . $path;
                break;

            default:
                return static::getRawImage($path);
                break;
        }
    }
949234
public function basePath($path = null) {
		$route = str_replace('.php', '', trim(Router::$route->route, '/'));

		$url_path = "//".Server::getName();
		$dir = ($route == 'install' || $route == 'update')?'vcs':'themes';
		$theme = ($route != 'install' && $route != 'update')?($this->getTheme().'/'):'';
		$file_path = '/'."$dir/".$theme."$path";

		return $url_path.(($path)?$file_path:'');
	}
857711
public static function getPath($path = '')
    {
        $path = ltrim($path, '/\\');
        $path = sprintf('%s%s%s', self::$applicationRoot, DIRECTORY_SEPARATOR, $path);
        $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
        return $path;
    }
819071
protected function getFilePath(string $path): string
    {
        if (empty($path)) {
            $path = $this->fileName;
        }

        return $path;
    }
270150
public function getUrl($path)
    {
        if (isset($this->bundleDir)) {
            $path = '/' . $this->bundleDir . '/' . self::THEMES_FOLDER . '/' . ltrim($path, '/');
        }

        return parent::getUrl($path);
    }
243102
protected function urlFromRoute($path = '')
    {
        $url = $this->baseURL;
        $url[] = $path;
        if (!empty($this->page)) $url[] = '?page=' . $this->page;
        return implode('', $url);
    }
1196563
public function getUrl( $path )
    {
        if (!$this->has($path)) throw new FileNotFoundException($filePath.' not found');
        return ( $this->ssl ? 'https://' : 'http://' ) . ( $this->isCname ? ( $this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain ) : $this->bucket . '.' . $this->endPoint ) . '/' . ltrim($path, '/');
    }
787325
public function getPath(string $path = ''): string
    {
        return $this->dirPath.($path ? DIRECTORY_SEPARATOR.$path : $path);
    }
87538
static public function urlToPath($path)
    {
        $path = parse_url($path);
        return $path === null ? null : str_replace('/', DIRECTORY_SEPARATOR, $path['path']);
    }