@param string $uri
@param string $query

@return bool|mixed
160049
public function has(string $uri, string $query = ''): bool
    {

        return $this->memcached->get($this->buildCacheKey($uri, $query)) !== false;
    }
147584
public function checkQuery($query = null)
  {
    if($query === null)
    {
      $query = $this->query;
    }

    if(strlen($query) == 0)
    {
      return TRUE;
    }

    $pattern = "/^" . $this->regex["uric"] . "*$/";
    $status = @preg_match($pattern, $query);

    if($status === FALSE)
    {
      throw new TeamSpeak3_Helper_Exception("URI query string validation failed");
    }

    return ($status == 1);
  }
692971
public function toRoute($route = null, $params = array(), $query = array())
    {
        if(!$route)
            return $this->refresh();

        $url = $this->urlFactory->create($route, $params, $query);

        return $this->to($url);
    }
164406
public static function mergeQuery($uri, $query)
    {
        return $uri->withQuery((string) (new Query(self::filterUri($uri)->getQuery()))->merge($query));
    }
1037099
public function query($query) {
		$args = func_get_args();
		$query = array_shift($args);
		return $this->execute($query, $args);
	}
235920
public function parse($uri)
	{
		// Initialise variables
		$retval = false;

		// Set the original URI to fall back on
		$this->uri = $uri;

		// Parse the URI and populate the object fields.  If URI is parsed properly,
		// set method return value to true.
		if ($parts = parse_url($uri))
		{
			$retval = true;
		}

		// We need to replace &amp; with & for parse_str to work right...
		if (isset($parts['query']) && strpos($parts['query'], '&amp;'))
		{
			$parts['query'] = str_replace('&amp;', '&', $parts['query']);
		}

		$data = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment');
		foreach ($data as $part)
		{
			$this->$part = isset($parts[$part]) ? $parts[$part] : null;
		}

		// Parse the query
		if (isset($parts['query']))
		{
			parse_str($parts['query'], $this->vars);
		}

		return $retval;
	}
49656
public static function filterQueryOrFragment($query)
    {
        if (!\is_string($query)) {
            throw new \InvalidArgumentException('Uri query string and fragment must be a string');
        }

        return preg_replace_callback(
            '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/u',
            function ($match) {
                return rawurlencode($match[0]);
            },
            $query
        ) ?? '';
    }
933068
private function http_build_query($query) {
        $uri = [];
        foreach($query as $k => $v) {
            array_push($uri, $k . '='. $v);
        }

        return implode('&', $uri);
    }
927530
private static function isValidUriQuery(?string $query): bool
    {
        if ($query === null || $query === '') {
            return true;
        }

        // http://tools.ietf.org/html/rfc3986#section-3.4
        // query = *( pchar / "/" / "?" )
        // pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
        $pattern = sprintf(
            '/\A(?:[%s%s\/?:@]|(?:%s))*\z/i',
            'a-z0-9\-._~',
            '!$&\'()*+,;=',
            '%[a-f0-9]{2}'
        );

        return !!preg_match($pattern, $query);
    }
1291066
public function search($query)
    {
        try {
            $request = $this->client->createRequest($query);
            $response = $this->executeRequest($request);
            $this->hasSearched = true;
            $this->responseCache = $response;
        } catch (HttpException $e) {
            $this->handleErrorResponses($e);
        }
        return $response;
    }
497518
public static function create(string $baseUri, array $query = []): string
    {
        if (count($query) === 0) {
            return $baseUri;
        }

        return sprintf('%s/?%s', $baseUri, http_build_query($query));
    }
1228247
private function query($query)
    {
		if(!is_array($query)) {
			return q($query);
		} else {
			foreach($query as $v) {
				q($v);
			}
			return true;
		}
    }
413071
final public function queryArray(string $query)
    {
        $result = $this->queryResult($query);
        if (false === $result) {
            return false;
        }

        $return = [];
        while (false !== $row = $result->fetchRow()) {
            $return[] = $row;
        }
        return $return;
    }
979661
public function fullUrlWithQuery(array $query)
    {
        parse_str($this->getUri()->getQuery(), $queryParts);

        return (string) $this->getUri()
            ->withQuery(http_build_query($query + $queryParts));
    }
1322524
public function get($path, $query = [])
    {
        // Add query parameters to $path?
        if (!empty($query)) {
            if (strpos($path, '?') === false) {
                $path .= '?'.http_build_query($query, '', '&');
            } else {
                $path .= ini_get('arg_separator.output').http_build_query($query, '', '&');
            }
        }

        // Start the request and return the response
        return $this->execute('GET', $path);
    }
79001
function requestURI( $uri )
    {
        $parsed = parse_url( $uri );

        $return = '';
        if ( isset( $parsed['user'] ) )
        {
            $return .= $parsed['user'] . '@' . $parsed['pass'];
        }
        $return .= rtrim( $parsed['path'], '/' ) . '/' . $this->Name;

        if ( isset( $parsed['query'] ) )
        {
            $return  .= '?' . $parsed['query'];
        }
        if ( isset( $parsed['fragment'] ) )
        {
            $return .= '#' . $parsed['fragment'];
        }

        return $return;
    }
187492
public function forget(string $uri, string $query = '')
    {

        $path = $this->buildRelativePath($uri, $query);
        $cache_file_path = $path . $this->results_filename;

        @unlink($cache_file_path);
    }