/var/www/html/protected/libs/framework/db/CDbConnection.php(382)
370 throw new CDbException('CDbConnection.connectionString cannot be empty.'); 371 try 372 { 373 Yii::trace('Opening DB connection','system.db.CDbConnection'); 374 $this->_pdo=$this->createPdoInstance(); 375 $this->initConnection($this->_pdo); 376 $this->_active=true; 377 } 378 catch(PDOException $e) 379 { 380 if(YII_DEBUG) 381 { 382 throw new CDbException('CDbConnection failed to open the DB connection: '. 383 $e->getMessage(),(int)$e->getCode(),$e->errorInfo); 384 } 385 else 386 { 387 Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException'); 388 throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo); 389 } 390 } 391 } 392 } 393 394 /**
#0 |
+
–
/var/www/html/protected/libs/framework/db/CDbConnection.php(330): CDbConnection->open() 325 public function setActive($value) 326 { 327 if($value!=$this->_active) 328 { 329 if($value) 330 $this->open(); 331 else 332 $this->close(); 333 } 334 } 335 |
#1 |
+
–
/var/www/html/protected/libs/framework/db/CDbConnection.php(308): CDbConnection->setActive(true) 303 */ 304 public function init() 305 { 306 parent::init(); 307 if($this->autoConnect) 308 $this->setActive(true); 309 } 310 311 /** 312 * Returns whether the DB connection is established. 313 * @return boolean whether the DB connection is established |
#2 |
+
–
/var/www/html/protected/libs/framework/base/CModule.php(387): CDbConnection->init() 382 if(!isset($config['enabled']) || $config['enabled']) 383 { 384 Yii::trace("Loading \"$id\" application component",'system.CModule'); 385 unset($config['enabled']); 386 $component=Yii::createComponent($config); 387 $component->init(); 388 return $this->_components[$id]=$component; 389 } 390 } 391 } 392 |
#3 |
+
–
/var/www/html/protected/libs/framework/base/CApplication.php(450): CModule->getComponent("db") 445 * Returns the database connection component. 446 * @return CDbConnection the database connection 447 */ 448 public function getDb() 449 { 450 return $this->getComponent('db'); 451 } 452 453 /** 454 * Returns the error handler component. 455 * @return CErrorHandler the error handler application component. |
#4 |
+
–
/var/www/html/protected/libs/framework/db/ar/CActiveRecord.php(634): CApplication->getDb() 629 { 630 if(self::$db!==null) 631 return self::$db; 632 else 633 { 634 self::$db=Yii::app()->getDb(); 635 if(self::$db instanceof CDbConnection) 636 return self::$db; 637 else 638 throw new CDbException(Yii::t('yii','Active Record requires a "db" CDbConnection application component.')); 639 } |
#5 |
+
–
/var/www/html/protected/libs/framework/db/ar/CActiveRecord.php(1428): CActiveRecord->getDbConnection() 1423 { 1424 if($checkScopes && ($criteria=$this->getDbCriteria(false))!==null && $criteria->alias!='') 1425 $alias=$criteria->alias; 1426 else 1427 $alias=$this->_alias; 1428 return $quote ? $this->getDbConnection()->getSchema()->quoteTableName($alias) : $alias; 1429 } 1430 1431 /** 1432 * Sets the table alias to be used in queries. 1433 * @param string $alias the table alias to be used in queries. The alias should NOT be quoted. |
#6 |
+
–
/var/www/html/protected/libs/framework/db/ar/CActiveRecord.php(1517): CActiveRecord->getTableAlias(true) 1512 * @return CActiveRecord the record found. Null if none is found. 1513 */ 1514 public function findByAttributes($attributes,$condition='',$params=array()) 1515 { 1516 Yii::trace(get_class($this).'.findByAttributes()','system.db.ar.CActiveRecord'); 1517 $prefix=$this->getTableAlias(true).'.'; 1518 $criteria=$this->getCommandBuilder()->createColumnCriteria($this->getTableSchema(),$attributes,$condition,$params,$prefix); 1519 return $this->query($criteria); 1520 } 1521 1522 /** |
#7 |
+
–
/var/www/html/protected/utils/Host.php(17): CActiveRecord->findByAttributes(array("host" => "kaluga.rodina.ru")) 12 } 13 14 static $site; 15 16 if (!$site) { 17 $site = Site::model()->findByAttributes(array('host' => $matches['host'])); 18 19 } 20 21 if (!$site) { 22 return false; |
#8 |
+
–
/var/www/html/protected/components/BaseController.php(20): Host::getCurrentSite("kaluga.rodina.ru") 15 16 public function init() 17 { 18 parent::init(); 19 20 $this->currentSite = $site = Host::getCurrentSite($_SERVER['HTTP_HOST']); 21 22 $this->mainSite = $mainSite = Site::getMainSite(); 23 24 if (!$site) { 25 |
#9 |
+
–
/var/www/html/protected/controllers/SiteController.php(20): BaseController->init() 15 public $bugReportForm; 16 17 public $slogan; 18 19 public function init() { 20 parent::init(); 21 22 if (!Yii::app()->user->isGuest && Yii::app()->user->getState('role') == 'user') { 23 $this->siteUser = User::model()->with(['avatar', 'cityInfo'])->findByPk(Yii::app()->user->id, 'deleted IS NULL'); 24 } elseif (!Yii::app()->user->isGuest && Yii::app()->user->getState('role') == 'admin') { 25 $admin = Admin::model()->with('user')->findByPk(Yii::app()->user->id); |
#10 |
+
–
/var/www/html/protected/libs/framework/web/CWebApplication.php(281): SiteController->init() 276 if(($ca=$this->createController($route))!==null) 277 { 278 list($controller,$actionID)=$ca; 279 $oldController=$this->_controller; 280 $this->_controller=$controller; 281 $controller->init(); 282 $controller->run($actionID); 283 $this->_controller=$oldController; 284 } 285 else 286 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".', |
#11 |
+
–
/var/www/html/protected/libs/framework/web/CWebApplication.php(141): CWebApplication->runController("site/congressTagView") 136 foreach(array_splice($this->catchAllRequest,1) as $name=>$value) 137 $_GET[$name]=$value; 138 } 139 else 140 $route=$this->getUrlManager()->parseUrl($this->getRequest()); 141 $this->runController($route); 142 } 143 144 /** 145 * Registers the core application components. 146 * This method overrides the parent implementation by registering additional core components. |
#12 |
+
–
/var/www/html/protected/libs/framework/base/CApplication.php(180): CWebApplication->processRequest() 175 public function run() 176 { 177 if($this->hasEventHandler('onBeginRequest')) 178 $this->onBeginRequest(new CEvent($this)); 179 register_shutdown_function(array($this,'end'),0,false); 180 $this->processRequest(); 181 if($this->hasEventHandler('onEndRequest')) 182 $this->onEndRequest(new CEvent($this)); 183 } 184 185 /** |
#13 |
+
–
/var/www/html/index.php(17): CApplication->run() 12 defined('YII_DEBUG') or define('YII_DEBUG', Config::$debug); 13 14 require_once ROOT_PATH . '/protected/libs/framework/yii.php' ; 15 $config = ROOT_PATH . '/configs/yii.php'; 16 17 Yii::createWebApplication($config)->run(); |