@param string $url
@param bool  $isGet

@return array
355755
public function getRequestUrlAndParameters($url, $isGet): array
    {
        if ($isGet === true) {
            return [$url . $this->getUri(), $this->getDefaultParameters()];
        }
        return [$url, array_merge($this->getDefaultParameters(), ['form_params' => $this->getParameters()])];
    }
1025202
public function getAll($isJSON = false, $reload = false)
    {
        if ($reload) {
            $this->init($reload);
        }

        if ($isJSON) {
            return Json::encode($this->data);
        }
        return $this->data;
    }
1156506
public function get($name, $isHtml = false)
    {
        $name = self::normalizeName($name);

        if (strpos($name, '[') !== false) {
            $names = explode('[', str_replace(']', '', $name));
            $key = array_shift($names);
            $item = isset($this->parameters[$key]) ? $this->parameters[$key] : [];

            foreach ($names as $key) {
                if (!isset($item[$key])) {
                    return;
                }

                $item = $item[$key];
            }

            return $isHtml ? $item : self::toPlainValue($item);
        }

        if (isset($this->parameters[$name])) {
            return $isHtml ? $this->parameters[$name] : self::toPlainValue($this->parameters[$name]);
        }
    }
785419
static function quickGet($url)
    {
        $bits = parse_url($url);
        $host = $bits['host'];
        $port = isset($bits['port']) ? $bits['port'] : 80;
        $path = isset($bits['path']) ? $bits['path'] : '/';
        if (isset($bits['query']))
        {
            $path .= '?' . $bits['query'];
        }
        $client = new self($host, $port);
        if (!$client->get($path))
        {
            return false;
        }
        else
        {
            return $client->getContent();
        }
    }
1272031
public static function getUrl($url_path,$params=array(),$isHttps=false){
		$url_path = trim($url_path,'/');
		$url =  self::getBaseUrl(). '/' .$url_path;
		if(!empty($params) && is_array($params)){
			$arr = [];
			foreach($params as $k=>$v){
				$arr[] = $k."=".$v;
			}
			return $url.'?'.implode('&',$arr);
		}
		return $url;
	}
1132224
private function parseUrl(string $url): array
    {
        $parts = parse_url($url);

        if ($parts === false || !isset($parts['host'])) {
            throw new \InvalidArgumentException(sprintf('Invalid connection URL given: "%s"', $url));
        }

        $params = [
            'login' => $parts['user'] ?? '',
            'password' => $parts['pass'] ?? '',
            'host' => $parts['host'],
            'port' => (int) ($parts['port'] ?? 5672),
            'vhost' => empty($parts['path']) || $parts['path'] === '/' ? '/' : substr($parts['path'], 1),
        ];

        parse_str($parts['query'] ?? '', $queryParams);

        return $params + $queryParams;
    }
1346356
public function callGetApi($url)
    {
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpGetForJson($url);
    }
305296
static public function getUploadUrl($isAbsolute=true)
    {
        $url = static::getCommon('uploadUrl');
        if ($isAbsolute && strpos($url, 'http') !== 0) {
            $baseUrl = static::getRootUrl();
            $url = rtrim($baseUrl, '/') . '/' . trim($url, '/');
        }
        
        return $url;
    }
223184
public function buildGetRequest($uri, $param = [], $headers = [], $isAsync = false)
    {
        $query_param = array_merge(['xh' => $this->stu_id], $param);
        $query = [
            'query' => $query_param,
            'headers' => $headers,
        ];
        if ($this->cacheCookie) {
            $query['cookies'] = $this->getCookie();
        }
        //If use getAll(), use the Async request.
        return $isAsync
            ? $this->client->getAsync($uri, $query)
            : $this->client->get($uri, $query);
    }
400794
public static function query(array $params = null, $useGet = false)
    {
        if ($useGet)
        {
            if (null === $params)
            {
                $params = $_GET;
            }
            else
            {
                $params = Arr::merge($_GET, $params);
            }
        }

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

        $query = http_build_query($params, '', '&');
        return ($query === '') ? '' : ('?' . $query);
    }
1225844
static public function fetchByUrl( $url, $mainTranslation = false )
    {
        $urlArray = is_array( $url ) ? $url : explode( '/', ltrim( $url, '/' ) );
        if ( !is_array( $urlArray ) || empty( $urlArray ) )
            return null;

        $parentID = 0;
        for ( $i = 0; $i < count( $urlArray ) - 1; $i++ )
        {
            /** @var eZTagsObject[] $tags */
            $tags = self::fetchList(
                array(
                    'parent_id' => $parentID,
                    'main_tag_id' => 0,
                    'keyword' => urldecode( trim( $urlArray[$i] ) )
                ),
                null,
                null,
                $mainTranslation
            );

            if ( !is_array( $tags ) || empty( $tags ) )
                return null;

            $parentID = $tags[0]->attribute( 'id' );
        }

        $tags = self::fetchList(
            array(
                'parent_id' => $parentID,
                'keyword' => urldecode( trim( $urlArray[count( $urlArray ) - 1] ) )
            ),
            null,
            null,
            $mainTranslation
        );

        if ( !is_array( $tags ) || empty( $tags ) )
            return null;

        return $tags[0];
    }
1160909
public function getLinks($all = false)
    {
        $links = [];

        $this->getLinksByTagAttribute("link", "href", $links);
        $this->getLinksByTagAttribute("a", "href", $links);
        $this->getLinksByTagAttribute("script", "src", $links);
        $this->getLinksByTagAttribute("iframe", "src", $links);
        $this->getLinksByTagAttribute("img", "src", $links);

        //get all string started with http
        $regexUrl = '/[">\s]+((http|https|ftp|ftps)\:\/\/(.*?))["<\s]+/';
        $urls     = null;
        if (preg_match_all($regexUrl, $this->html, $urls) > 0) {
            $matches = $urls[1];
            foreach ($matches as $url) {
                if (filter_var($url, FILTER_VALIDATE_URL)) {
                    $links[$url] = $url;
                }
            }
        }

        if ($all) {
            //get all params which can be a url
            $regexParam = '/["](.*?)["]/';
            $params     = [];
            if (preg_match_all($regexParam, $this->html, $params) > 0) {
                $urls = $params[1];
                foreach ($urls as $url) {
                    $url = trim($url);
                    if ((strpbrk($url, "/.") !== false) && (strpbrk($url, " ") === false)) {
                        $links[$url] = $url;
                    }
                }
            }
        }

        foreach ($links as $link) {
            $url = parse_url($link);
            if (!((isset($url['host']) && isset($url['scheme'])) || (isset($url['path'])))) {
                unset($links[$link]);
            }
        }

        return $links;
    }
1120103
static function FileGet($url, $data = "", $verify_cert = false, $timeout = 30)
	{
		$qs = HttpRequest::ArrayToQueryString($data);
		$full_url = $url . ($qs ? "?" . $qs : "");
		return file_get_contents( $full_url );
	}
601318
static function get($namespace, $name = null, $isall = false)
    {
        $cacheName = 'config:'.$namespace;
        if (!Cache::has($cacheName)) {
            $data = self::setCache($namespace);
        } else {
            $data = Cache::get($cacheName, []);
            if($name) {
                if(!$isall) return isset($data[$name]['value']) ? $data[$name]['value'] : null;
                return isset($data[$name]) ? $data[$name] : [];
            }
        }
        if(!$isall) {
            $rdata = array();
            foreach ($data as $key => $value) {
                $rdata[$key] = $value['value'];
            }
            return $rdata;
        }
        return $data;
    }
830977
public function extractShortUrl(string $url):array {
		$urls = [$url];

		while($url = $this->extract($url)){
			$urls[] = $url;
		}

		return $urls;
	}
811971
public function parse(Url $url) :? array
	{
		// Get path without possible file
		$path = $url->path();

		// Build route pattern
		$pattern = $this->buildRoutePattern();

		if (preg_match($pattern, $path, $matches) === 1) {

			$variables = [];
			$length = sizeof($matches);

			for ($i = 1; $i < $length; $i++) {
				$variables[$this->parameter[$i - 1]] = $matches[$i];
			}

			return $variables;
		}

		return null;
	}
843519
private function initiateGet($url, $params)
    {;
        if (!empty($params))
        {
            $parameter=implode(array_values($params));
            $url .= '/'.$parameter;
        }
        $ch = curl_init($this->host.'/'.$url);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authentication: Token ". $this->token));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        return $ch;
    }