Error Info: Array ( [0] => HY000 [1] => 1 [2] => Can't create/write to file '/tmp/#sql_3c4_0.MYI' (Errcode: 28) )
in /home/rocketuser/web/rocketparents.com/public_html/vendor/yiisoft/yii2/db/Command.php at line 902
$exceptionClass = '\yii\db\Exception'; foreach ($this->exceptionMap as $error => $class) { if (strpos($e->getMessage(), $error) !== false) { $exceptionClass = $class; } } $message = $e->getMessage() . "\nThe SQL being executed was: $rawSql"; $errorInfo = $e instanceof \PDOException ? $e->errorInfo : null; return new $exceptionClass($message, $errorInfo, (int) $e->getCode(), $e); } /** * Returns a value indicating whether a SQL statement is for read purpose. * @param string $sql the SQL statement * @return bool whether a SQL statement is for read purpose. */ public function isReadQuery($sql) {
$this->pdoStatement->closeCursor(); } Yii::endProfile($token, 'yii\db\Command::query'); } catch (\Exception $e) { Yii::endProfile($token, 'yii\db\Command::query'); throw $this->db->getSchema()->convertException($e, $rawSql); } if (isset($cache, $cacheKey, $info)) { $cache->set($cacheKey, [$result], $info[1], $info[2]); Yii::trace('Saved query result in cache', 'yii\db\Command::query'); }
* @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 $fetchMode the result fetch mode. Please refer to [PHP manual](http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php)
* @throws \Exception if DB query fails */ protected function findColumns($table) { $sql = 'SHOW FULL COLUMNS FROM ' . $this->quoteTableName($table->fullName); try { $columns = $this->db->createCommand($sql)->queryAll(); } catch (\Exception $e) { $previous = $e->getPrevious(); if ($previous instanceof \PDOException && strpos($previous->getMessage(), 'SQLSTATE[42S02') !== false) { // table does not exist // https://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html#error_er_bad_table_error return false;
*/ protected function loadTableSchema($name) { $table = new TableSchema; $this->resolveTableNames($table, $name); if ($this->findColumns($table)) { $this->findConstraints($table); return $table; } else { return null; }
} return $this->_tables[$name]; } } return $this->_tables[$name] = $this->loadTableSchema($realName); } /** * Returns the cache key for the specified table name. * @param string $name the table name * @return mixed the cache key
* @throws InvalidConfigException if the table for the AR class does not exist. */ public static function getTableSchema() { $tableSchema = static::getDb() ->getSchema() ->getTableSchema(static::tableName()); if ($tableSchema === null) { throw new InvalidConfigException('The table does not exist: ' . static::tableName()); } return $tableSchema;
/** * @inheritdoc */ public static function populateRecord($record, $row) { $columns = static::getTableSchema()->columns; foreach ($row as $name => $value) { if (isset($columns[$name])) { $row[$name] = $columns[$name]->phpTypecast($value); } } parent::populateRecord($record, $row);
/* @var $class ActiveRecord */ $class = $this->modelClass; if ($this->indexBy === null) { foreach ($rows as $row) { $model = $class::instantiate($row); $modelClass = get_class($model); $modelClass::populateRecord($model, $row); $models[] = $model; } } else { foreach ($rows as $row) { $model = $class::instantiate($row); $modelClass = get_class($model);
public function populate($rows) { if (empty($rows)) { return []; } $models = $this->createModels($rows); if (!empty($this->join) && $this->indexBy === null) { $models = $this->removeDuplicatedModels($models); } if (!empty($this->with)) { $this->findWith($this->with, $models); }
* if the query results in nothing. */ public function one($db = null) { $row = parent::one($db); if ($row !== false) { $models = $this->populate([$row]); return reset($models) ?: null; } else { return null; } }
/** * @inheritdoc * @return NameCard|array|null */ public function one($db = null) { return parent::one($db); } /** * Get full name cards * @return $this ActiveQuery */
private function getModel($slug, $class) { $activeQuery = call_user_func($class . '::find'); $result = $activeQuery ->where(['slug' => $slug]) ->andWhere(['=', 'isVisible', NameCard::$VISIBLE_YES]) ->one(); return $result; } }
{ if (preg_match('#^[\w-]+$#', $slug)) { $path = $this->getPath(); foreach ($path as $route => $class) { //Name Card and Category if ($route === self::CARD_ROUTE || $route === self::CATEGORY_ROUTE) { if ($this->getModel($slug, $class) !== null) { return $route; } //Origin } else if ($route === self::ORIGIN_ROUTE) { $slugArr = explode('-', $slug); //Origin with gender
if ($slugArr[1] === 'page') { $page = (int)$slugArr[2]; } $slug = $slugArr[0]; } //Route if (($route = $this->getRoute($slug)) !== false) { return isset($page) ? [$route, ['slug' => $slug, 'page' => $page]] : [$route, ['slug' => $slug]]; } return false; }
*/ public function parseRequest($request) { if ($this->enablePrettyUrl) { /* @var $rule UrlRule */ foreach ($this->rules as $rule) { $result = $rule->parseRequest($this, $request); if (YII_DEBUG) { Yii::trace([ 'rule' => method_exists($rule, '__toString') ? $rule->__toString() : get_class($rule), 'match' => $result !== false, 'parent' => null ], __METHOD__);
* Resolves the current request into a route and the associated parameters. * @return array the first element is the route, and the second is the associated parameters. * @throws NotFoundHttpException if the request cannot be resolved. */ public function resolve() { $result = Yii::$app->getUrlManager()->parseRequest($this); if ($result !== false) { list ($route, $params) = $result; if ($this->_queryParams === null) { $_GET = $params + $_GET; // preserve numeric keys } else { $this->_queryParams = $params + $this->_queryParams;
* @throws NotFoundHttpException if the requested route is invalid */ public function handleRequest($request) { if (empty($this->catchAll)) { try { list ($route, $params) = $request->resolve(); } catch (UrlNormalizerRedirectException $e) { $url = $e->url; if (is_array($url)) { if (isset($url[0])) { // ensure the route is absolute $url[0] = '/' . ltrim($url[0], '/');
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__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();