Return all scheme lookup paths.

@param string $scheme
@return array
548926
public function getPaths($scheme = null)
    {
        return !$scheme ? $this->schemes : (isset($this->schemes[$scheme]) ? $this->schemes[$scheme] : []);
    }
671046
public function filterScheme($scheme)
    {
        $valids = [
            ''      => true,
            'http'  => true,
            'https' => true,
        ];
        $scheme = str_replace('://', '', strtolower((string) $scheme));
        if (!isset($valids[$scheme])) {
            throw new \InvalidArgumentException('Uri scheme must be one of: "", "https", "http"');
        }

        return $scheme;
    }
860769
public function getPaths($extension = null)
	{
		if (isset($extension))
		{
			if (isset($this->paths[$extension]))
			{
				return $this->paths[$extension];
			}

			return;
		}

		return $this->paths;
	}
857989
public function getRoute($path, $domain = null, $scheme = null)
    {
        $uri = ($scheme ?? $this->scheme) . '://' . ($domain ?? $this->domain) . $path;

        return $this->find($uri);
    }
55823
protected function dirnameInternal(?string $scheme, string $path, int $levels = 1): array
    {
        $path = \dirname($path, $levels);

        if (null !== $scheme && $path === '.') {
            return [$scheme, ''];
        }

        return [$scheme, $path];
    }
1131023
public function getClassifications($scheme = null)
    {
        return array_values(array_filter(Classification::get($this), function ($classifications) use ($scheme) {
            $a = is_null($scheme) || $scheme == $classifications->getScheme();

            return $a;
        }));
    }
234456
protected function getRootUrl($scheme, $root = null)
	{
		if (is_null($root))
		{
			if (is_null($this->cachedRoot))
			{
				$this->cachedRoot = $this->forcedRoot ?: $this->request->root();
			}

			$root = $this->cachedRoot;
		}

		$start = starts_with($root, 'http://') ? 'http://' : 'https://';

		return preg_replace('~'.$start.'~', $scheme, $root, 1);
	}
753521
protected function marshalScheme($scheme): ? string
    {
        if ( null === $scheme ) {
            return null;
        }

        if ( ! is_string($scheme) ) {
            throw new UriException(
                'Scheme must be a string'
            );
        }

        return strtolower($scheme);
    }
202643
public function get($scheme = self::REL)
    {
        $data = $this->data;
        if ($scheme == self::REL) {
            unset($data['scheme'], $data['host'], $data['user'], $data['pass'], $data['port']);
            return $this->build($data);
        }
        if (!isset($data['host'])) {
            $data['host'] = $this->request->getHost();
        }
        if (!isset($data['scheme'])) {
            $scheme = self::SHORT_ABS;
        }

        if ($scheme == self::SHORT_ABS) {
            unset($data['scheme']);
            $url = $this->build($data, '//');
        } else {
            $url = $this->build($data);
        }

        return $this->asProtect($url, $data['host']);
    }
717456
public function assertSchemeIs($scheme)
    {
        $pattern = str_replace('\*', '.*', preg_quote($scheme, '/'));

        $actual = parse_url($this->driver->getCurrentURL(), PHP_URL_SCHEME) ?? '';

        PHPUnit::assertRegExp(
            '/^'.$pattern.'$/u', $actual,
            "Actual scheme [{$actual}] does not equal expected scheme [{$pattern}]."
        );

        return $this;
    }
1192796
public function getPaths($sub = null)
    {
        $paths = [];

        foreach ($this->moduleLoader->getRegisteredModules() as $module) {
            if (is_dir($dir = $module->getPath($sub))) {
                // This path has a file, add it to the list
                $paths[$module->getName()] = $dir;
            }
        }

        return $paths;
    }
633293
public function getSchemaSearchPaths()
    {
        $params = $this->_conn->getParams();
        $schema = explode(',', $this->_conn->fetchColumn('SHOW search_path'));

        if (isset($params['user'])) {
            $schema = str_replace('"$user"', $params['user'], $schema);
        }

        return array_map('trim', $schema);
    }
1021491
public function match(string $path): array
    {
        $path = $path === '/' ? $path : \rtrim($path, '/ ');

        if (!isset($this->routes[$path])) {
            return [self::NOT_FOUND, $path];
        }

        return [self::FOUND, $this->routes[$path]];
    }
701257
public function withScheme($scheme)
    {
        $scheme = str_replace('://', '', strtolower((string)$scheme));

        if (!empty($scheme) && !array_key_exists($scheme, $this->schemes)) {
            throw new InvalidArgumentException('Invalid scheme provided.');
        }

        return $this->_clone('scheme', $scheme);
    }
876686
protected function nUrlScheme($scheme)
    {
        if (!($scheme = (string) $scheme)) {
            return $scheme; // Nothing to do.
        }
        if (mb_strpos($scheme, ':') !== false) {
            $scheme = strstr($scheme, ':', true);
        }
        return mb_strtolower($scheme);
    }
998488
public function getUrlForScheme($scheme)
    {
        $newUrl = clone $this;

        $wasDefaultPort = ($newUrl->hasScheme() && $newUrl->isPortDefault());

        $newUrl->_fragments['scheme'] = $scheme;
        if ($wasDefaultPort) {
            $newUrl->_fragments['port'] = $newUrl->getDefaultPort();
        }

        $newUrl->_inputString = $newUrl->__toString();

        return $newUrl;
    }
491040
protected function filterScheme($scheme)
    {
        $scheme = strtolower($scheme);
        $scheme = preg_replace('#:(//)?$#', '', $scheme);

        if (empty($scheme)) {
            return '';
        }

        if (!array_key_exists($scheme, $this->allowedSchemes)) {
            throw new InvalidArgumentException(sprintf(
                'Unsupported scheme "%s"; must be any empty string or in the set (%s)',
                $scheme,
                implode(', ', array_keys($this->allowedSchemes))
            ));
        }

        return $scheme;
    }