@param string                             $uri
@param string                             $query
@param \Seat\Eseye\Containers\EsiResponse $data

@return mixed|void
518406
public function set(string $uri, string $query, EsiResponse $data)
    {

        $path = $this->buildRelativePath($this->safePath($uri), $query);

        // Create the subpath if that does not already exist
        if (! file_exists($path))
            @mkdir($path, 0775, true);

        // Dump the contents to file
        file_put_contents($path . $this->results_filename, serialize($data));
    }
398167
public static function addQueryParameters(UriInterface $uri, array $queryParameters)
    {
        $originalQuery = $uri->getQuery();
        $originalQueryParameters = [];
        parse_str($originalQuery, $originalQueryParameters);
        $newQueryParameters = array_replace_recursive($originalQueryParameters, $queryParameters);
        $newQuery = http_build_query($newQueryParameters);
        $newUri = $uri->withQuery($newQuery);
        return $newUri;
    }
804874
function Post($uri, $query_params = '') {
      $uri = $this->makeUri($uri);

      if (is_array($query_params)) {
        $postArray = array();
        reset($query_params);
        while (list($k, $v) = each($query_params)) {
          $postArray[] = urlencode($k) . '=' . urlencode($v);
        }

        $this->requestBody = implode('&', $postArray);
      }

// set the content type for post parameters
      $this->addHeader('Content-Type', 'application/x-www-form-urlencoded');

      if ($this->sendCommand('POST ' . $uri . ' HTTP/' . $this->protocolVersion)) {
        $this->processReply();
      }

      $this->removeHeader('Content-Type');
      $this->removeHeader('Content-Length');
      $this->requestBody = '';

      return $this->reply;
    }
355055
public function query ($query, $data = array(), $entity = null)
		{
			if ($this->cache->isCached($query)) {
				return $this->cache->getCachedResult($query);
			} else {
				try {
					$statement = $this->database->prepare((string) $query, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
					$result = $statement->execute($data);
					$this->lastQuery = $statement->queryString;
					$this->lastStatement = $statement;

					if (! $result) {
						throw new DatabaseException(implode(': ', $statement->errorInfo()) . PHP_EOL . PHP_EOL . $query);
					}

				} catch (PDOException $e) {
					throw new DatabaseException($e->getMessage() . PHP_EOL . PHP_EOL . $query);
				}

				$databaseResult = $this->createResult($statement, $entity);

				if ($query instanceof DatabaseQuery && $databaseResult instanceof DatabaseResult) {
					$this->cache->cacheQuery($query, $databaseResult);
				}

				if ($query instanceof DatabaseQuery) {
					$this->cache->refreshCache($query);
				}

				if ($databaseResult instanceof DatabaseResult) {
					return $databaseResult;

				} else if ($query instanceof DatabaseQuery && $query->getType() == DatabaseQuery::QUERY_TYPE_INSERT) {
					return $this->insertId($query->getTable());

				} else {
					return $databaseResult;
				}
			}
		}
1006587
protected function executeQuery($url, array $data = array(), array $extra_result_data = array())
    {
        $headers = array(
            sprintf('Authorization: Bearer %s', $this->accessToken),
            'Content-Type: application/json',
            'Accept: application/json'
        );

        // Issue the request
        $content = $this->getAdapter()->getContent($url, 'POST', $headers, json_encode($data));

        if (null === $content) {
            return array_merge($this->getDefaults(), $extra_result_data);
        }

        return $this->parseResults($content, $extra_result_data);
    }
1350465
public function forget(string $uri, string $query = '')
    {

        return $this->memcached->delete($this->buildCacheKey($uri, $query));
    }
1084733
public function delete($query, array $data) {
        $stmt = $this->executeQuery($query, $data);
        
        return $stmt->rowCount();       
    }
282204
private function updateQueryTranslation(Query $query, array $parameterData, string $locale): void
    {
        $updateStruct = $this->collectionService->newQueryUpdateStruct($locale, $query);
        $updateStruct->fillParametersFromHash($query->getQueryType(), $parameterData, true);

        $this->collectionService->updateQuery($query, $updateStruct);
    }
67230
public function post($url, $data)
	{
		$this->init($url);
		$this->setPost($data);
		$this->exec();
		$this->fin();
	}
481919
public function putReq(string $url, $data = [], $dataQuery = [])
    {
        $query = http_build_query($dataQuery);
        $ch    = curl_init($url . '?' . $query);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        if ($this->authType == self::BASIC) {
            curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
            curl_setopt($ch, CURLOPT_USERPWD, $this->authParam);
        } else {
            if ($this->authType == self::SAFE) {
                curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANYSAFE);
                curl_setopt($ch, CURLOPT_USERPWD, $this->authParam);
            }
        }
        $result = curl_exec($ch);
        curl_close($ch);

        return $result;
    }
349178
public function redirect(string $url, array $data = []) : void
    {
        $this->redirectUrl = $url;
        $this->redirectData = $data;
    }
93662
private function sendQuery($query, array $data = null) {
        if (!is_null($data)) {
            $Template = new QueryTemplate();
            $Template->load($query);
            pg_send_query($this->Resource, $Template->parse($data));
        } else {
            pg_send_query($this->Resource, $query);
        }
    }
887921
public function buildDataUri(string $uri, array $data): Uri
    {

        // Create a query string for the URI. We automatically
        // include the datasource value from the configuration.
        $query_params = array_merge([
            'datasource' => $this->getConfiguration()->datasource,
        ], $this->getQueryString());

        return Uri::fromParts([
            'scheme' => $this->getConfiguration()->esi_scheme,
            'host'   => $this->getConfiguration()->esi_host,
            'port'   => $this->getConfiguration()->esi_port,
            'path'   => rtrim($this->getVersion(), '/') .
                $this->mapDataToUri($uri, $data),
            'query'  => http_build_query($query_params),
        ]);
    }
808363
public function buildUriWithQuery($uri, array $params = [])
    {
        $uri = uri_for($uri);

        if (!Uri::isAbsolute($uri)) {
            $uri = $uri->withScheme($this->baseURL->getScheme())
                ->withUserInfo($this->baseURL->getUserInfo())
                ->withHost($this->baseURL->getHost())
                ->withPort($this->baseURL->getPort());
        }

        $default = [
            'username' => $this->username,
            'password' => $this->password,
        ];

        return $uri->withQuery(build_query(array_merge($default, $params)));
    }
618637
public function doQuery($query, $data = null)
	{
		// Prepare the entered query
		$prepQuery = parent::prepare($query);
		// Execute query, return result
		return $prepQuery->execute($data);
	}
1231852
private function updateQueryTranslations(Query $query, array $translationsData): void
    {
        $mainLocale = $query->getMainLocale();

        foreach ($query->getAvailableLocales() as $locale) {
            if ($locale === $mainLocale) {
                continue;
            }

            if (!array_key_exists($locale, $translationsData)) {
                throw new RuntimeException(
                    sprintf('Could not find locale "%s" in the given query data', $locale)
                );
            }

            $this->updateQueryTranslation($query, $translationsData[$locale], $locale);
        }
    }
271119
public function request($method, $uri, array $data = array())
    {
        $path = $this->path() . '/' . trim($uri, '/');

        $session = curl_init();

        // Curious as why i have to do this
        if ($method === 'PUT') {
            curl_setopt($session, CURLOPT_POSTFIELDS, http_build_query($data));
        } else {
            $path .= '?' . http_build_query($data);
        }

        curl_setopt($session, CURLOPT_HEADER, true);
        curl_setopt($session, CURLOPT_HTTPHEADER, $this->defaultHeaders());
        curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($session, CURLOPT_POST, $method !== 'GET');

        curl_setopt($session, CURLOPT_URL, $path);
        curl_setopt($session, CURLOPT_CUSTOMREQUEST, $method);
        $response = curl_exec($session);
        $statusCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
        $headerSize = curl_getinfo($session, CURLINFO_HEADER_SIZE);
        $body = substr($response, $headerSize);

        if ($statusCode !== 200) {
            throw new InvalidRequest($body);
        }

        curl_close($session);

        return json_decode($body, true);
    }