in /home/hclinic/public_html/new/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)
* @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
/** * Checks if necessary tables exist and if not, create them. */ protected function checkTables() { if (Yii::$app->db->schema->getTableSchema($this->tableUsers, true) === null) { if ($this->autoInstallTables) { Yii::$app->db->createCommand() ->createTable( $this->tableUsers, array( 'user_ip' => 'VARCHAR(255) NOT NULL PRIMARY KEY',
/** * */ public function init() { $this->checkTables(); $this->refresh(); } /** * Checks if necessary tables exist and if not, create them. */
*/ 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.
return $reflection->newInstanceArgs($dependencies); } if (!empty($dependencies) && $reflection->implementsInterface('yii\base\Configurable')) { // set $config as the last parameter (existing one will be overwritten) $dependencies[count($dependencies) - 1] = $config; return $reflection->newInstanceArgs($dependencies); } else { $object = $reflection->newInstanceArgs($dependencies); foreach ($config as $name => $value) { $object->$name = $value; } return $object;
public function get($class, $params = [], $config = []) { if (isset($this->_singletons[$class])) { // singleton return $this->_singletons[$class]; } elseif (!isset($this->_definitions[$class])) { return $this->build($class, $params, $config); } $definition = $this->_definitions[$class]; if (is_callable($definition, true)) { $params = $this->resolveDependencies($this->mergeParams($class, $params));
{ if (is_string($type)) { return static::$container->get($type, $params); } elseif (is_array($type) && isset($type['class'])) { $class = $type['class']; unset($type['class']); return static::$container->get($class, $params, $type); } elseif (is_callable($type, true)) { return call_user_func($type, $params); } elseif (is_array($type)) { throw new InvalidConfigException('Object configuration must be an array containing a "class" element.'); } else { throw new InvalidConfigException("Unsupported configuration type: " . gettype($type));
if (isset($this->_definitions[$id])) { $definition = $this->_definitions[$id]; if (is_object($definition) && !$definition instanceof Closure) { return $this->_components[$id] = $definition; } else { return $this->_components[$id] = Yii::createObject($definition); } } elseif ($throwException) { throw new InvalidConfigException("Unknown component ID: $id"); } else { return null; }
* @param string $name component or property name * @return mixed the named property value */ public function __get($name) { if ($this->has($name)) { return $this->get($name); } else { return parent::__get($name); } } /**
if(empty($language)){ $session->set('language', 'id-ID'); $language = $session['language']; } \Yii::$app->language = $language; \Yii::$app->userCounter->init(); if(isset($_GET['utm_source'])){ $utmsource = $_GET['utm_source']; $utmcampaign = $_GET['utm_campaign']; $session = Yii::$app->session; $session->set('utm_source', $utmsource);
break; } } $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules
$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__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'title' => 'miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', ]; $_SERVER = [ 'CONTEXT_DOCUMENT_ROOT' => '/home/hclinic/public_html/new', 'CONTEXT_PREFIX' => '', 'DOCUMENT_ROOT' => '/home/hclinic/public_html/new', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'HTTPS' => 'on', 'HTTP_ACCEPT' => '*/*', 'HTTP_HOST' => 'www.miracle-clinic.com', 'HTTP_REFERER' => 'https://miracle-clinic.com/news/read?title=miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', 'HTTP_USER_AGENT' => 'claudebot', 'PATH' => '/bin:/usr/bin', 'PHP_INI_SCAN_DIR' => '/opt/cpanel/ea-php54/root/etc:/opt/cpanel/ea-php54/root/etc/php.d:.', 'QUERY_STRING' => 'title=miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', 'REDIRECT_HTTPS' => 'on', 'REDIRECT_QUERY_STRING' => 'title=miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', 'REDIRECT_REDIRECT_HTTPS' => 'on', 'REDIRECT_REDIRECT_SSL_TLS_SNI' => 'www.miracle-clinic.com', 'REDIRECT_REDIRECT_STATUS' => '200', 'REDIRECT_REDIRECT_UNIQUE_ID' => 'ZgWlk6qdO1yvql6JmCSnnAAAAFQ', 'REDIRECT_SSL_TLS_SNI' => 'www.miracle-clinic.com', 'REDIRECT_STATUS' => '200', 'REDIRECT_UNIQUE_ID' => 'ZgWlk6qdO1yvql6JmCSnnAAAAFQ', 'REDIRECT_URL' => '/frontend/web/news/read', 'REMOTE_ADDR' => '54.198.45.0', 'REMOTE_PORT' => '54440', 'REQUEST_METHOD' => 'GET', 'REQUEST_SCHEME' => 'https', 'REQUEST_URI' => '/news/read?title=miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', 'SCRIPT_FILENAME' => '/home/hclinic/public_html/new/frontend/web/index.php', 'SCRIPT_NAME' => '/frontend/web/index.php', 'SERVER_ADDR' => '162.213.210.219', 'SERVER_ADMIN' => 'webmaster@miracle-clinic.com', 'SERVER_NAME' => 'www.miracle-clinic.com', 'SERVER_PORT' => '443', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'SSL_TLS_SNI' => 'www.miracle-clinic.com', 'TZ' => 'Asia/Jakarta', 'UNIQUE_ID' => 'ZgWlk6qdO1yvql6JmCSnnAAAAFQ', 'PHP_SELF' => '/frontend/web/index.php', 'REQUEST_TIME_FLOAT' => 1711646102.2652280330657958984375, 'REQUEST_TIME' => 1711646102, 'argv' => [ 'title=miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', ], 'argc' => 1, ]; $_SESSION = [ '__flash' => [], 'language' => 'id-ID', ]; $_ENV = [ 'CONTEXT_DOCUMENT_ROOT' => '/home/hclinic/public_html/new', 'CONTEXT_PREFIX' => '', 'DOCUMENT_ROOT' => '/home/hclinic/public_html/new', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'HTTPS' => 'on', 'HTTP_ACCEPT' => '*/*', 'HTTP_HOST' => 'www.miracle-clinic.com', 'HTTP_REFERER' => 'https://miracle-clinic.com/news/read?title=miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', 'HTTP_USER_AGENT' => 'claudebot', 'PATH' => '/bin:/usr/bin', 'PHP_INI_SCAN_DIR' => '/opt/cpanel/ea-php54/root/etc:/opt/cpanel/ea-php54/root/etc/php.d:.', 'QUERY_STRING' => 'title=miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', 'REDIRECT_HTTPS' => 'on', 'REDIRECT_QUERY_STRING' => 'title=miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', 'REDIRECT_REDIRECT_HTTPS' => 'on', 'REDIRECT_REDIRECT_SSL_TLS_SNI' => 'www.miracle-clinic.com', 'REDIRECT_REDIRECT_STATUS' => '200', 'REDIRECT_REDIRECT_UNIQUE_ID' => 'ZgWlk6qdO1yvql6JmCSnnAAAAFQ', 'REDIRECT_SSL_TLS_SNI' => 'www.miracle-clinic.com', 'REDIRECT_STATUS' => '200', 'REDIRECT_UNIQUE_ID' => 'ZgWlk6qdO1yvql6JmCSnnAAAAFQ', 'REDIRECT_URL' => '/frontend/web/news/read', 'REMOTE_ADDR' => '54.198.45.0', 'REMOTE_PORT' => '54440', 'REQUEST_METHOD' => 'GET', 'REQUEST_SCHEME' => 'https', 'REQUEST_URI' => '/news/read?title=miracle-aesthetic-clinic-pertahankan-gelar-the-best-marketing-campaign', 'SCRIPT_FILENAME' => '/home/hclinic/public_html/new/frontend/web/index.php', 'SCRIPT_NAME' => '/frontend/web/index.php', 'SERVER_ADDR' => '162.213.210.219', 'SERVER_ADMIN' => 'webmaster@miracle-clinic.com', 'SERVER_NAME' => 'www.miracle-clinic.com', 'SERVER_PORT' => '443', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'SSL_TLS_SNI' => 'www.miracle-clinic.com', 'TZ' => 'Asia/Jakarta', 'UNIQUE_ID' => 'ZgWlk6qdO1yvql6JmCSnnAAAAFQ', ];