in /data/www/nashstyle.com.ua/vendor/yiisoft/yii2/db/Connection.php at line 698
if ($enableProfiling) { Yii::endProfile($token, __METHOD__); } } catch (\PDOException $e) { if ($enableProfiling) { 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 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; } /**
* * @return bool * @see https://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html */ private function supportsFractionalSeconds() { $version = $this->db->getSlavePdo()->getAttribute(\PDO::ATTR_SERVER_VERSION); return version_compare($version, '5.6.4', '>='); } /** * Returns the map for default time type. * If the version of MySQL is lower than 5.6.4, then the types will be without fractional seconds,
$map = [ Schema::TYPE_DATETIME => 'datetime', Schema::TYPE_TIMESTAMP => 'timestamp', Schema::TYPE_TIME => 'time', ]; if ($this->supportsFractionalSeconds()) { $map = [ Schema::TYPE_DATETIME => 'datetime(0)', Schema::TYPE_TIMESTAMP => 'timestamp(0)', Schema::TYPE_TIME => 'time(0)', ]; }
* {@inheritdoc} */ public function init() { parent::init(); $this->typeMap = array_merge($this->typeMap, $this->defaultTimeTypeMap()); } /** * {@inheritdoc} */ protected function defaultExpressionBuilders()
*/ public function __construct($config = []) { if (!empty($config)) { Yii::configure($this, $config); } $this->init(); } /** * Initializes the object. * This method is invoked at the end of the constructor after the object is initialized with the * given configuration.
* @param Connection $connection the database connection. * @param array $config name-value pairs that will be used to initialize the object properties */ public function __construct($connection, $config = []) { $this->db = $connection; parent::__construct($config); } /** * {@inheritdoc} */ public function init()
/** * Creates a query builder for the MySQL database. * @return QueryBuilder query builder instance */ public function createQueryBuilder() { return new QueryBuilder($this->db); } /** * Resolves the table name and schema name (if any). * @param TableSchema $table the table metadata object * @param string $name the table name
/** * @return QueryBuilder the query builder for this connection. */ public function getQueryBuilder() { if ($this->_builder === null) { $this->_builder = $this->createQueryBuilder(); } return $this->_builder; } /**
/** * Returns the query builder for the current DB connection. * @return QueryBuilder the query builder for the current DB connection. */ public function getQueryBuilder() { return $this->getSchema()->getQueryBuilder(); } /** * Can be used to set [[QueryBuilder]] configuration via Connection configuration array. * * @param array $value the [[QueryBuilder]] properties to be configured.
$modelClass = $this->modelClass; if ($db === null) { $db = $modelClass::getDb(); } if ($this->sql === null) { list($sql, $params) = $db->getQueryBuilder()->build($this); } else { $sql = $this->sql; $params = $this->params; } $command = $db->createCommand($sql, $params);
*/ 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. * 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)
* Повертає перелік мов * @return array Lang */ static function getList() { if (self::$list === NULL) { $list_all = Lang::find()->published()->all(); $l = array(); foreach ($list_all as $data) { $l[$data->alias] = $data; } self::$list = $l;
*/ static function isExists($alias = NULL) { if ($alias === NULL) { return FALSE; } else { if (self::$list == NULL) { self::getList(); } return (isset(self::$list[$alias])) ? TRUE : FALSE; } } }
* @return string */ public static function processLangInUrl($url) { if (self::MULTI) { $domains = self::setDomains($url); $exists = (isset($domains[0])) ? Lang::isExists($domains[0]) : false; $_def = Lang::getDefaultLang(); $isDefault = ($_def->alias == $domains[0]) ? true : false; if ($exists && !$isDefault) { $lang = Lang::getLangByAlias($domains[0]); Yii::$app->language = $lang['local'];
/** * * @return string */ protected function resolveRequestUri() { if ($this->_requestUri === null) { $this->_requestUri = MultiLanguage::processLangInUrl(parent::resolveRequestUri()); } return $this->_requestUri; } /** *
* @return string the currently requested relative URL. Note that the URI returned may be URL-encoded depending on the client. * @throws InvalidConfigException if the URL cannot be determined due to unusual server configuration */ public function getUrl() { if ($this->_url === null) { $this->_url = $this->resolveRequestUri(); } return $this->_url; } /**
*/ public function __get($name) { $getter = 'get' . $name; if (method_exists($this, $getter)) { // read property, e.g. getName() return $this->$getter(); } // behavior property $this->ensureBehaviors(); foreach ($this->_behaviors as $behavior) { if ($behavior->canGetProperty($name)) {
if (!$this->customRedirectParamsKey || !$this->customRedirectEnable || !isset(\Yii::$app->params[$this->customRedirectParamsKey]) || !\Yii::$app->params[$this->customRedirectParamsKey]) { return; } $arr_urls = \Yii::$app->params[$this->customRedirectParamsKey]; if (isset($arr_urls[$request->url]) && $arr_urls[$request->url] && $request->url != $arr_urls[$request->url]) { header('Location: '.$arr_urls[$request->url], true, 301); exit; } } }
$this->setBaseUrl(MultiLanguage::getBaseUrl()); return parent::getBaseUrl(); } public function parseRequest($request) { $this->customRedirect($request); return parent::parseRequest($request); } /** * * @return NULL
* 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__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = \yii\helpers\ArrayHelper::merge( require(__DIR__ . '/../thread/config/main.php'), require(__DIR__ . '/../thread/config/main-local.php'), require(__DIR__ . '/core/config/main.php'), require(__DIR__ . '/core/config/main-local.php') ); (new \yii\web\Application($config))->run();
$_GET = [ 'filters' => '376=L', 'razmeri111' => [ 'L', ], 'onpage' => '50', ];