in /var/www/data/vendor/yiisoft/yii2/db/Connection.php at line 579
$token = 'Opening DB connection: ' . $this->dsn; try { Yii::info($token, __METHOD__); Yii::beginProfile($token, __METHOD__); $this->pdo = $this->createPdoInstance(); $this->initConnection(); Yii::endProfile($token, __METHOD__); } catch (\PDOException $e) { Yii::endProfile($token, __METHOD__); throw new Exception($e->getMessage(), $e->errorInfo, (int) $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 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; } else { 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(); } try { $this->pdoStatement = $pdo->prepare($sql);
Yii::trace('Query result served from cache', 'yii\db\Command::query'); return $result[0]; } } } $this->prepare(true); $token = $rawSql; try { Yii::beginProfile($token, 'yii\db\Command::query'); $this->pdoStatement->execute();
* @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 integer $fetchMode the result fetch mode. Please refer to [PHP manual](http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php)
* @param Connection $db the database connection used to generate the SQL statement. * If this parameter is not given, the `db` application component will be used. * @return array the query results. If the query results in nothing, an empty array will be returned. */ public function all($db = null) { $rows = $this->createCommand($db)->queryAll(); return $this->populate($rows); } /** * Converts the raw query results into the format as specified by this query. * This method is internally used to convert the data fetched from database
* @param Connection $db the DB connection used to create the DB command. * If null, the DB connection returned by [[modelClass]] will be used. * @return array|ActiveRecord[] the query results. If the query results in nothing, an empty array will be returned. */ public function all($db = null) { return parent::all($db); } /** * @inheritdoc */ public function prepare($builder)
if(is_null($car_compl_id)) $car_compl_id = $compl_id; */ // var_dump($car_compl_id); exit; $casco = Casco::find()->orderBy('region')->all(); $insurance = Insurance::find()->orderBy('sort')->all(); $models = Models::find()->orderBy('sort')->all(); $banks = Banks::find()->orderBy('sort')->all(); $programs = Programs::find()->where(['active' => 1])->all();
$args = $this->controller->bindActionParams($this, $params); Yii::trace('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); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
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 = [ 'old_car_id' => '32', 'old_compl_id' => '317', 'compl_id' => '336', ]; $_SERVER = [ 'PHP_EXTRA_CONFIGURE_ARGS' => '--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi', 'HOSTNAME' => '1d68b44138a1', 'PHP_INI_DIR' => '/usr/local/etc/php', 'HOME' => '/var/www', 'PHP_LDFLAGS' => '-Wl,-O1 -Wl,--hash-style=both -pie', 'PHP_CFLAGS' => '-fstack-protector-strong -fpic -fpie -O2', 'PHP_MD5' => '', 'PHP_VERSION' => '5.6.40', 'GPG_KEYS' => '0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3', 'PHP_CPPFLAGS' => '-fstack-protector-strong -fpic -fpie -O2', 'PHP_ASC_URL' => 'https://secure.php.net/get/php-5.6.40.tar.xz.asc/from/this/mirror', 'PHP_URL' => 'https://secure.php.net/get/php-5.6.40.tar.xz/from/this/mirror', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'PHPIZE_DEPS' => 'autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c', 'PWD' => '/var/www/data', 'PHP_SHA256' => '1369a51eee3995d7fbd1c5342e5cc917760e276d561595b6052b21ace2656d1c', 'USER' => 'www-data', 'FCGI_ROLE' => 'RESPONDER', 'QUERY_STRING' => 'old_car_id=32&old_compl_id=317&compl_id=336', 'REQUEST_METHOD' => 'GET', 'CONTENT_TYPE' => '', 'CONTENT_LENGTH' => '', 'SCRIPT_NAME' => '/index.php', 'REQUEST_URI' => '/configurator/finance/?old_car_id=32&old_compl_id=317&compl_id=336', 'DOCUMENT_URI' => '/index.php', 'DOCUMENT_ROOT' => '/var/www/data/web', 'SERVER_PROTOCOL' => 'HTTP/1.0', 'REQUEST_SCHEME' => 'http', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_SOFTWARE' => 'nginx/1.19.4', 'REMOTE_ADDR' => '172.18.0.9', 'REMOTE_PORT' => '38342', 'SERVER_ADDR' => '172.18.0.7', 'SERVER_PORT' => '80', 'SERVER_NAME' => 'www.configurator.hyundai.ru', 'REDIRECT_STATUS' => '200', 'SCRIPT_FILENAME' => '/var/www/data/web/index.php', 'HTTP_HOST' => 'www.configurator.hyundai.ru', 'HTTP_X_REAL_IP' => '44.222.186.148', 'HTTP_X_FORWARDED_FOR' => '44.222.186.148, 44.222.186.148', 'HTTP_CONNECTION' => 'close', 'HTTP_ACCEPT' => '*/*', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_REFERER' => 'https://configurator.hyundai.ru/configurator/finance/?old_car_id=32&old_compl_id=317&compl_id=336', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1711717697.499265, 'REQUEST_TIME' => 1711717697, 'argv' => [ 'old_car_id=32&old_compl_id=317&compl_id=336', ], 'argc' => 1, ];