Разбивает URL на протокол и остальную часть
@param $url

@return array
345421
public static function splitUrl($url) {
		$splitData = array();
		if(preg_match('/(https?)*(:\/\/)*(.*)/', $url, $matches)) {
			$splitData[] = (isset($matches[1]) && !empty($matches[1])) ? $matches[1] : 'http';
			$splitData[] = (isset($matches[3]) && !empty($matches[3])) ? $matches[3] : '';
		}
		return $splitData;
	}
422970
private function getHostFromUrl($url)
    {
        if (strpos($url, '//')) {
            $url = substr($url, strpos($url, '//') + 2);
        }
        if (($p = strpos($url, '/')) !== false) {
            $url = substr($url, 0, $p);
        }
        return $url;
    }
1371004
protected function getQueryOptions($url)
    {
        $queryString = $url['query'] ?? null;

        if (! $queryString) {
            return [];
        }

        $query = [];

        parse_str($queryString, $query);

        return $this->parseStringsToNativeTypes($query);
    }
461096
protected function parseUrl($url)
    {
        if (strpos($url, '//') === 0) {
            $url = "http:$url";
        }

        $this->info = parse_url($url);

        if (isset($this->info['query'])) {
            parse_str($this->info['query'], $this->info['query']);

            array_walk_recursive($this->info['query'], function (&$value) {
                $value = urldecode($value);
            });
        }

        if (isset($this->info['path'])) {
            $this->setPath($this->info['path']);
        }
    }
971277
protected function extractUrlVariables($url){
        $variables = array();
        $pattern = "/(\\".static::$_URL_VAR_CHARACTER.".*?[^\\/]*)/";
        if (preg_match($pattern,$url,$matches)){
            array_shift($matches);
            foreach($matches as $match){
                $variables[] = $match[0];
            }
        }
        return $variables;
    }
998133
protected function fetchURL($URL)
    {
        $cookieHeader = [];
        if ($this->cookie) {
            $cookieHeader[] = 'Cookie: ' . $this->cookie . ';';
        }

        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $URL);
        curl_setopt($curl, CURLOPT_HEADER, 1);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_HTTPHEADER, $cookieHeader);

        $body = null;
        $result = curl_exec($curl);
        if ($result) {
            $parts = explode("\r\n\r\n", $result, 2);
            $headers = explode("\r\n", $parts[0]);
            if (!$this->cookie) {
                $setCookieString = 'Set-Cookie: ';
                foreach ($headers as $header) {
                    if (strpos($header, $setCookieString) === 0) {
                        $cookieString = substr($header, strlen($setCookieString));
                        $cookieStringParts = explode(';', $cookieString);
                        $this->cookie = $cookieStringParts[0];
                        break;
                    }
                }
            }

            $body = $parts[1];
        }

        return $body;
    }
521995
public static function parse_URL($url)
	{
		$params = parse_url($url);
		$params['extras'] = array();
		if (isset($params['query']))
		{
			parse_str($params['query'], $params['extras']);
		}
		return $params;
	}
1075802
public function discover(string $url) : array
    {
        $explorer = new Explorer($this->client, $this->logger);

        return $explorer->discover($url);
    }
556233
protected static function encode_url($url)
    {
        $reserved = array(
            ':' => '!%3A!ui',
            '/' => '!%2F!ui',
            '?' => '!%3F!ui',
            '#' => '!%23!ui',
            '[' => '!%5B!ui',
            ']' => '!%5D!ui',
            '@' => '!%40!ui',
            '!' => '!%21!ui',
            '$' => '!%24!ui',
            '&' => '!%26!ui',
            "'" => '!%27!ui',
            '(' => '!%28!ui',
            ')' => '!%29!ui',
            '*' => '!%2A!ui',
            '+' => '!%2B!ui',
            ',' => '!%2C!ui',
            ';' => '!%3B!ui',
            '=' => '!%3D!ui',
            '%' => '!%25!ui'
        );
        $url = preg_replace(array_values($reserved), array_keys($reserved), rawurlencode($url));
        return $url;
    }
362795
protected function urlEncode($url)
    {
        $reserved = [
            ":" => '!%3A!ui',
            "/" => '!%2F!ui',
            "?" => '!%3F!ui',
            "#" => '!%23!ui',
            "[" => '!%5B!ui',
            "]" => '!%5D!ui',
            "@" => '!%40!ui',
            "!" => '!%21!ui',
            "$" => '!%24!ui',
            "&" => '!%26!ui',
            "'" => '!%27!ui',
            "(" => '!%28!ui',
            ")" => '!%29!ui',
            "*" => '!%2A!ui',
            "+" => '!%2B!ui',
            "," => '!%2C!ui',
            ";" => '!%3B!ui',
            "=" => '!%3D!ui',
            "%" => '!%25!ui'
        ];
        return preg_replace(array_values($reserved), array_keys($reserved), rawurlencode($url));
    }
132893
public static function getParameters($url)
    {
        if (!$url) {
            return false;
        }
        $urlQuery = [];
        if ($query = parse_url($url)) {
            $query = explode('&', $query);
            foreach ($query as $item) {
                list($key, $value) = explode('=', $item);
                $urlQuery[$key] = $value;
            }
        }
        return $urlQuery;
    }
199724
static public function httpGet($url)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($curl, CURLOPT_SSLVERSION, 1);
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl));
        return (intval($status["http_code"]) === 200) ? $content : false;
    }
742301
private function getUrlOrigin($url)
    {
        return array(
            parse_url($url, PHP_URL_SCHEME),
            parse_url($url, PHP_URL_HOST),
            parse_url($url, PHP_URL_PORT),
        );
    }
894718
public function fetchUrl($url)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        // HTTPS
        if (strpos($url, 'https://') !== false) {
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        }

        $res = curl_exec($ch);
        curl_close($ch);

        return $res;
    }
548823
public static function url($url){

		$url = static::_nullValue($url);
		if(!$url){

			return $url;
		}

		$query = parse_url($url, PHP_URL_QUERY);
		if(!$query){

			return $url;
		}

		parse_str($query, $query_parts);

		// First urldecode to be sure that we do not re-encode the query parts.
		$query_parts = array_map('static::_nested_urldecode', $query_parts);

		// http_build_query will take care of the urlencode.
		return strtok($url, '?') . '?' . http_build_query($query_parts);
	}
729114
private function match(string $url): ?array
    {
        $path = \trim(\explode('?', $url, 2)[0], self::SEPARATOR_TRIM);

        $key = $this->prefix . '_' . $path;
        $result = self::optimizeGet($key);
        if (!empty($result)) {
            return $result;
        }

        $parts = \explode('/', $path);
        if (!isset($parts[1]) && $parts[0] === '') {
            $parts = [];
        }

        $params = [];
        $current = $this->routes;
        foreach ($parts as $v) {
            if (isset($current['children'][$v])) {
                $current = $current['children'][$v];
                continue;
            }

            if ($current['regexps'] !== []) {
                foreach ($current['regexps'] as $regexp => $route) {
                    if (\preg_match($regexp, $v)) {
                        $current = $route;
                        $params[$current['name']] = $v;
                        continue 2;
                    }
                }
            }

            if (!isset($current['others'])) {
                return null;
            }

            $current = $current['others'];
            $params[$current['name']] = $v;
        }

        $result = [
            'methods' => $current['methods'],
            'route' => $current['route'],
            'params' => $params,
        ];

        self::optimizeSet($key, $result);

        return $result;
    }
1366972
public function locate($url)
    {
        $key = $this->getLocale().'-'.$url;

        if(!isset($this->_locations[$key]))
        {
            $result = array();
            $info   = array(
                'url'     => $url,
                'locale'  => $this->getLocale(),
                'path'    => '',
            );

            $this->_locations[$key] = $this->find($info);
        }

        return $this->_locations[$key];
    }