Error Info: Array ( [0] => HY000 [1] => 2002 [2] => Connection refused )
in /home/y/yuriyiru/cybers.work/vendor/yiisoft/yii2/db/Connection.php at line 722
if ($enableProfiling) { Yii::endProfile($token, __METHOD__); } } catch (\PDOException $e) { if ($enableProfiling) { Yii::endProfile($token, __METHOD__); } throw new Exception($e->getMessage(), $e->errorInfo, $e->getCode(), $e); } } /** * Closes the currently active DB connection. * It does nothing if the connection is already closed. */ public function close() {
* Returns the PDO instance for the currently active master connection. * This method will open the master DB connection and then return [[pdo]]. * @return PDO the PDO instance for the currently active master connection. */ public function getMasterPdo() { $this->open(); return $this->pdo; } /** * Returns the currently active slave connection. * If this method is called for the first time, it will try to open a slave connection when [[enableSlaves]] is true.
* is available and `$fallbackToMaster` is false. */ public function getSlavePdo($fallbackToMaster = true) { $db = $this->getSlave(false); if ($db === null) { return $fallbackToMaster ? $this->getMasterPdo() : null; } return $db->pdo; } /**
if ($this->db->getTransaction()) { // master is in a transaction. use the same connection. $forRead = false; } if ($forRead || $forRead === null && $this->db->getSchema()->isReadQuery($sql)) { $pdo = $this->db->getSlavePdo(); } else { $pdo = $this->db->getMasterPdo(); } if (!empty($this->floatParams)) { $sql = $this->parseFloatParams($sql);
Yii::debug('Query result served from cache', 'yii\db\Command::query'); return $result[0]; } } } $this->prepare(true); try { $profile and Yii::beginProfile($rawSql, 'yii\db\Command::query'); $this->internalExecute($rawSql);
* @return array all rows of the query result. Each array element is an array representing a row of data. * An empty array is returned if the query results in nothing. * @throws Exception execution failed */ public function queryAll($fetchMode = null) { return $this->queryInternal('fetchAll', $fetchMode); } /** * Executes the SQL statement and returns the first row of the result. * This method is best used when only the first row of result is needed for a query. * @param int|null $fetchMode the result fetch mode. Please refer to [PHP manual](https://www.php.net/manual/en/pdostatement.setfetchmode.php)
* @return array all index names in the Sphinx. */ protected function findIndexes() { $sql = 'SHOW TABLES'; return $this->db->createCommand($sql)->queryAll(); } /** * @return QueryBuilder the query builder for this connection. */ public function getQueryBuilder()
* Initializes information about name and type of all index in the Sphinx. */ protected function initIndexesInfo() { $this->_indexNames = []; $this->_indexTypes = []; $indexes = $this->findIndexes(); foreach ($indexes as $index) { $indexName = $index['Index']; $this->_indexNames[] = $indexName; $this->_indexTypes[$indexName] = $index['Type']; } }
* index types fetched previously (if available) will be returned. * @return array all index types in the Sphinx in format: index name => index type. */ public function getIndexTypes($refresh = false) { if (!isset($this->_indexTypes) || $refresh) { $this->initIndexesInfo(); } return $this->_indexTypes; } /**
/** * Resolves the index name. * @param IndexSchema $index the index metadata object */ protected function resolveIndexType($index) { $indexTypes = $this->getIndexTypes(); $index->type = array_key_exists($index->name, $indexTypes) ? $indexTypes[$index->name] : 'unknown'; $index->isRt = ($index->type == 'rt'); } /** * Obtains the metadata for the named index.
* @return IndexSchema|null driver dependent index metadata. `null` - if the index does not exist. */ protected function loadIndexSchema($name) { $index = new IndexSchema(); $this->resolveIndexNames($index, $name); $this->resolveIndexType($index); if ($this->findColumns($index)) { return $index; } return null; }
} return $this->_indexes[$name] = $index; } } return $this->_indexes[$name] = $this->loadIndexSchema($realName); } /** * Returns the cache key for the specified index name. * @param string $name the index name * @return mixed the cache key
* @param string $name index name. * @param bool $refresh whether to reload the table schema even if it is found in the cache. * @return IndexSchema index schema information. Null if the named index does not exist. */ public function getIndexSchema($name, $refresh = false) { return $this->getSchema()->getIndexSchema($name, $refresh); } /** * Quotes a index name for use in a query. * If the index name contains schema prefix, the prefix will also be properly quoted. * If the index name is already quoted or contains special characters including '(', '[[' and '{{',
*/ private function getIndexSchemas($indexes) { $indexSchemas = []; if (!empty($indexes)) { foreach ($indexes as $indexName) { $index = $this->db->getIndexSchema($indexName); if ($index !== null) { $indexSchemas[] = $index; } } } return $indexSchemas;
} } if (empty($condition)) { return ''; } $indexSchemas = $this->getIndexSchemas($indexes); $where = $this->buildCondition($indexSchemas, $condition, $params); return $where === '' ? '' : 'WHERE ' . $where; } /**
$from = [$modelClass::indexName()]; } $clauses = [ $this->buildSelect($query->select, $params, $query->distinct, $query->selectOption), $this->buildFrom($from, $params), $this->buildWhere($from, $query->where, $params, $query->match), $this->buildGroupBy($query->groupBy, $query->groupLimit), $this->buildWithin($query->within), $this->buildHaving($query->from, $query->having, $params), $this->buildOrderBy($query->orderBy), $this->buildLimit($query->limit, $query->offset), $this->buildOption($query->options, $params),
* @return Command the created Sphinx command instance. */ public function createCommand($db = null) { $this->setConnection($db); $db = $this->getConnection(); list ($sql, $params) = $db->getQueryBuilder()->build($this); return $db->createCommand($sql, $params); } /** * {@inheritdoc}
public function all($db = null) { if ($this->emulateExecution) { return []; } $rows = $this->createCommand($db)->queryAll(); return $this->populate($rows); } /** * Converts the raw query results into the format as specified by this query.
->match($word) ->andWhere(['confirm' => 1]) ->limit(50) ->offset(($page - 1) * 50) ->orderBy(['date' => SORT_DESC]) //->asArray() ->all(); } public function sphinxpagecount($word) {
} } $model = new Job(); $all = $model->sphinxsearchmodel($word, $page); $pagecount = (int)$model->sphinxpagecount($word); } else { $model_job = new Job();
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php'; $config = require __DIR__ . '/../config/web.php'; (new yii\web\Application($config))->run();
$_GET = [ 'keyword' => 'Сервисный инженер', 'old-job' => 'true', ];