Выполняет запрос к источнику и возвращает ассоциативный массив значений

@param  string  $query    Запрос в формате источника
@return  array|bool  Ответ в виде массива или FALSE в случае ошибки
@deprecated
765520
public function query_array($query)
	{
        Eresus_Kernel::log(__METHOD__, LOG_NOTICE, 'This method is deprecated');
		$db = Eresus_DB::getHandler();
		$stmt = $db->prepare($query);
		if (!$stmt->execute())
		{
			return false;
		}

		$values = $stmt->fetchAll(PDO::FETCH_ASSOC);
		return $values;
	}
8567
public function getRawData($query)
    {

        $this->query['query'] = $query;

        // clear error description
        if (isset($this->query['errstr'])) {
            unset($this->query['errstr']);
        }

        if (!isset($this->query['server'])) {
            $this->query['status'] = 'error';
            $this->query['errstr'][] = 'No server specified';
            return (array());
        }

        // Check if protocol is http
        if (substr($this->query['server'], 0, 7) == 'http://' ||
            substr($this->query['server'], 0, 8) == 'https://'
        ) {
            $output = $this->httpQuery($this->query['server']);

            if (!$output) {
                $this->query['status'] = 'error';
                $this->query['errstr'][] = 'Connect failed to: ' . $this->query['server'];
                return (array());
            }

            $this->query['args'] = substr(strchr($this->query['server'], '?'), 1);
            $this->query['server'] = strtok($this->query['server'], '?');

            if (substr($this->query['server'], 0, 7) == 'http://') {
                $this->query['server_port'] = 80;
            } else {
                $this->query['server_port'] = 443;
            }
        } else {
            // Get args
            if (strpos($this->query['server'], '?')) {
                $parts = explode('?', $this->query['server']);
                $this->query['server'] = trim($parts[0]);
                $query_args = trim($parts[1]);

                // replace substitution parameters
                $query_args = str_replace('{query}', $query, $query_args);
                $query_args = str_replace('{version}', 'phpWhois' . $this->codeVersion, $query_args);

                $iptools = new IpTools;
                if (strpos($query_args, '{ip}') !== false) {
                    $query_args = str_replace('{ip}', $iptools->getClientIp(), $query_args);
                }

                if (strpos($query_args, '{hname}') !== false) {
                    $query_args = str_replace('{hname}', gethostbyaddr($iptools->getClientIp()), $query_args);
                }
            } else {
                if (empty($this->query['args'])) {
                    $query_args = $query;
                } else {
                    $query_args = $this->query['args'];
                }
            }

            $this->query['args'] = $query_args;

            if (substr($this->query['server'], 0, 9) == 'rwhois://') {
                $this->query['server'] = substr($this->query['server'], 9);
            }

            if (substr($this->query['server'], 0, 8) == 'whois://') {
                $this->query['server'] = substr($this->query['server'], 8);
            }

            // Get port
            if (strpos($this->query['server'], ':')) {
                $parts = explode(':', $this->query['server']);
                $this->query['server'] = trim($parts[0]);
                $this->query['server_port'] = trim($parts[1]);
            } else {
                $this->query['server_port'] = $this->port;
            }

            // Connect to whois server, or return if failed
            $ptr = $this->connect();

            if ($ptr === false) {
                $this->query['status'] = 'error';
                $this->query['errstr'][] = 'Connect failed to: ' . $this->query['server'];
                return array();
            }

            stream_set_timeout($ptr, $this->stimeout);
            stream_set_blocking($ptr, 0);

            // Send query
            fputs($ptr, trim($query_args) . "\r\n");

            // Prepare to receive result
            $raw = '';
            $start = time();
            $null = null;
            $r = array($ptr);

            while (!feof($ptr)) {
                if (!empty($r)) {
                    if (stream_select($r, $null, $null, $this->stimeout)) {
                        $raw .= fgets($ptr, $this->buffer);
                    }
                }

                if (time() - $start > $this->stimeout) {
                    $this->query['status'] = 'error';
                    $this->query['errstr'][] = 'Timeout reading from ' . $this->query['server'];
                    return array();
                }
            }

            if (array_key_exists($this->query['server'], $this->NON_UTF8)) {
                $raw = utf8_encode($raw);
            }

            $output = explode("\n", $raw);

            // Drop empty last line (if it's empty! - saleck)
            if (empty($output[count($output) - 1])) {
                unset($output[count($output) - 1]);
            }
        }

        return $output;
    }
180176
private function cURL($query)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
        curl_setopt($curl, CURLOPT_VERBOSE, '1');
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, '0');
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, '0');
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_SSLCERT, $this->certPath);
        curl_setopt($curl, CURLOPT_SSLKEY, $this->certPath);
        curl_setopt($curl, CURLOPT_SSLKEYPASSWD, $this->certPass);
        curl_setopt($curl, CURLOPT_URL, $this->submitUri);
        $result = curl_exec($curl);
        curl_close($curl);

        return $result;
    }
468995
public function hasMappableFields(String $query) : Array
	{
		$fields = [];

		if (preg_match("/=([^ ]+)?/s", $query, $matches)) {
			$fields = $matches;
		}

		return $fields;
	}
1125747
protected function executeQuery($query)
    {
        $dataBase = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
        $success = true;
        try {
            $dataBase->execute($query);
        } catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) {
            \OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]);
            $success = false;
        }

        return $success;
    }
830885
public function doPostTaxonomyFiltering($query)
    {
        // Do not execute this in admin view
        if (is_admin() || !(is_archive() || is_home() || is_category() || is_tax() || is_tag()) || !$query->is_main_query()) {
            return $query;
        }

        $postType = $this->getPostType();
        $filterable = $this->getEnabledTaxonomies($postType, false);

        if (empty($filterable)) {
            return $query;
        }

        $taxQuery = array('relation' => 'AND');

        foreach ($filterable as $key => $value) {
            if (!isset($_GET['filter'][$key]) || empty($_GET['filter'][$key]) || $_GET['filter'][$key] === '-1') {
                continue;
            }

            $terms = (array)$_GET['filter'][$key];

            $taxQuery[] = array(
                'taxonomy' => $key,
                'field' => 'slug',
                'terms' => $terms,
                'operator' => 'IN'
            );
        }

        if (is_tax() || is_category() || is_tag()) {
            $taxQuery = array(
                'relation' => 'AND',
                array(
                    'relation' => 'AND',
                    array(
                        'taxonomy' => get_queried_object()->taxonomy,
                        'field' => 'slug',
                        'terms' => (array)get_queried_object()->slug,
                        'operator' => 'IN'
                    )
                ),
                $taxQuery
            );
        }

        $taxQuery = apply_filters('Municipio/archive/tax_query', $taxQuery, $query);

        $query->set('tax_query', $taxQuery);
        return $query;
    }
282870
public function decode($query): array
    {
        foreach (explode("&", $query) as $keyValuePair) {
            list($key, $value) = $this->decodePair($keyValuePair);
            $this->values->addValue($key, $value);
        }
        return $this->values->getValues();
    }
1253322
public static function getOne($query)
    {
        $ret = null;

        $res = self::query($query);
        if ($res) {
            if ($row = self::connection()->sql_fetch_assoc($res)) {
                $ret = reset($row);
            }
            self::free($res);
        }

        return $ret;
    }
935907
public function parse($query)
    {
        $queries = array();
        parse_str($query, $queries);

        return new Query($this->parseHttpQueryComponents($queries), $this->getPersister());
    }
596808
public function find($query)
    {
        $output = [];
        foreach (array_keys($this->items) as $key) {
            if (strpos($key, $query) !== false) {
                $output[$key] = $this->items[$key];
            }
        }

        return $output;
    }
526672
public function sanityzeQueryStringBool(array $query)
    {
        foreach ($query as $key => $value) {
            if (\is_bool($value)) {
                $query[$key] = ($value) ? 'true' : 'false';
            }
        }

        return $query;
    }
43896
public function search($query) {
        global $CFG;
        if ($result = parent::search($query)) {
            return $result;
        }

        $found = false;
        $filternames = filter_get_all_installed();
        foreach ($filternames as $path => $strfiltername) {
            if (strpos(core_text::strtolower($strfiltername), $query) !== false) {
                $found = true;
                break;
            }
            if (strpos($path, $query) !== false) {
                $found = true;
                break;
            }
        }

        if ($found) {
            $result = new stdClass;
            $result->page = $this;
            $result->settings = array();
            return array($this->name => $result);
        } else {
            return array();
        }
    }
108339
protected function getDefaultWhere($query)
    {
        if (!request()->ajax()) {
            $query->whereRaw('(tbl_ban_management_rules.expired_at > "' . date('Y-m-d H:i:s', time()) . '")');
            return false;
        } else {
            $columns = request()->get('columns', []);
            $found   = array_where($columns, function($item, $index) {
                return strlen(array_get($item, 'search.value')) > 0;
            });
            if (empty($found)) {
                return ['tbl_ban_management_rules.status' => 1];
            }
        }
        return false;
    }
373750
public function query($query) {

        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
            return $this->connection->ExecQuery($query);
        } else {
            $execString = $this->connectionString . '"' . $query . '"';
            $aReturn = Array();
            $inc = $wmiout = $execstatus = null;
            exec($execString, $wmiout, $execstatus);
            $wmiCount = count($wmiout);

            if ($wmiCount > 0) {
                $names = explode('|', $wmiout[1]); // build the names list to dymanically output it
                for ($i = 2; $i < $wmiCount; $i++) { // dynamically output the key:value pairs to suit cacti
                    $data = explode('|', $wmiout[$i]);
                    $j = 0;
                    $inc = $i - 2;
                    $aReturn[$inc] = new \stdClass();
                    foreach ($data as $item) {
                        $jIndex = $j++;
                        if (isset($names[$jIndex])) {
                            $objName = $names[$jIndex];
                            $aReplace = array(':', '_', '  ', '   ', '    ', '     ', '      ', '       ', '        ', '         ', '          ', '           ', '            ');
                            $aReplace2 = array('(null)', 'True', 'False');
                            $preparedData = str_replace($aReplace2, array(null, true, false), str_replace($aReplace, ' ', $item));

                            $aReturn[$inc]->$objName = $preparedData;
                        } else {
                            $j = $jIndex - 1;
                        }
                    }
                }
            }
            $stdObjReturn = (object) $aReturn;

            return $stdObjReturn;
        }
    }
831101
public function query($query)
    {
        // Replace prefix placeholder with prefix
        $query = str_replace("{prefix}", $this->prefix, $query);

        // Log last query and query count
        $this->lastQuery = $query;
        $this->queryCount++;

        // Query database
        return $this->connection->query($query);
    }
355186
public function fetch($query)
    {
        $db = $this->connection();

        if(method_exists($result = $db->query(rtrim(preg_replace('/\s\s/', ' ', $query), ' ')), 'rowCount')) {

            if($result->rowCount() && $result->setFetchMode($db::FETCH_ASSOC)) {

                return $result->fetchAll();
            }

            return false;
        }
    }
520620
public static function search($query) {
    global $server;
    $response = $server->doCall('search', ['query' => $query]);
    $result = [];
    foreach ($response->getValue('list') as $item) {
      $result[] = ['type' => $item['type'], 'oid' => $item['oid'],
        'displayValue' => $item['displayValue'], 'summary' => $item['summary']
      ];
    }
    return ['return' => $result];
  }