CDbConnection failed to open the DB connection: SQLSTATE[08004] [1040] Too many connections
/home/admin3/web/foodtest.ru/public_html/info/protected/helpers/global.php(111)
099 function substr_unicode($str, $s, $l = null) { 100 return join("", array_slice( 101 preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY), $s, $l)); 102 } 103 104 105 /** 106 * Returns the setting value 107 * This is the shortcut to Yii::app()->settings->get($category, $param); 108 */ 109 function setting($category, $param) 110 { 111 return Yii::app()->settings->get($category, $param);; 112 } 113 114 /** 115 * Return true if shop with $shop_id is approved to user 116 */ 117 function isUserShop($shop_id) 118 { 119 if ( Yii::app()->user->isGuest ) 120 return false; 121 122 $user_profile = Yii::app()->getModule('user')->user()->profile(); 123 if( $user_profile->shop_id == $shop_id && $user_profile->shop_approved == 1 )
#0 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/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 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/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 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/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 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/protected/components/CmsSettings.php(408): CModule->getComponent("db") 403 /** 404 * @return CDbConnection the db connection component 405 */ 406 protected function getDbComponent() 407 { 408 return Yii::app()->getComponent($this->getDbComponentId()); 409 } 410 411 protected function addDbItem($category='system', $key, $value) 412 { 413 $connection=$this->getDbComponent(); |
#4 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/protected/components/CmsSettings.php(510): CmsSettings->getDbComponent() 505 /** 506 * create the settings table 507 */ 508 protected function createTable() 509 { 510 $connection=$this->getDbComponent(); 511 $tableName=$connection->tablePrefix.str_replace(array('{{','}}'), '', $this->getTableName()); 512 $sql='CREATE TABLE IF NOT EXISTS `'.$tableName.'` ( 513 `id` int(11) NOT NULL auto_increment, 514 `category` varchar(64) NOT NULL default \'system\', 515 `key` varchar(255) NOT NULL, |
#5 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/protected/components/CmsSettings.php(43): CmsSettings->createTable() 38 { 39 parent::init(); 40 Yii::app()->attachEventHandler('onEndRequest', array($this, 'whenRequestEnds')); 41 42 if($this->getCreateTable()) 43 $this->createTable(); 44 } 45 46 47 /** 48 * CmsSettings::set() |
#6 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/framework/base/CModule.php(387): CmsSettings->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 |
#7 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/framework/base/CModule.php(103): CModule->getComponent("settings") 098 * @return mixed the named property value 099 */ 100 public function __get($name) 101 { 102 if($this->hasComponent($name)) 103 return $this->getComponent($name); 104 else 105 return parent::__get($name); 106 } 107 108 /** |
#8 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/protected/helpers/global.php(111): CModule->__get("settings") 106 * Returns the setting value 107 * This is the shortcut to Yii::app()->settings->get($category, $param); 108 */ 109 function setting($category, $param) 110 { 111 return Yii::app()->settings->get($category, $param);; 112 } 113 114 /** 115 * Return true if shop with $shop_id is approved to user 116 */ |
#9 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/protected/components/IPBlocker.php(8): setting("Main", "ban_ips") 03 class IPBlocker extends CApplicationComponent 04 { 05 06 public function init() 07 { 08 $ban_ips = explode(',', trim(setting('Main','ban_ips')) ); 09 $ips = array(); 10 if (count($ban_ips) > 0 ) { 11 foreach ($ban_ips as $ban_ip) { 12 $ip = trim($ban_ip); 13 if ( $ip ) $ips[] = $ip; |
#10 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/framework/base/CModule.php(387): IPBlocker->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 |
#11 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/framework/base/CModule.php(523): CModule->getComponent("IPBlocker") 518 * Loads static application components. 519 */ 520 protected function preloadComponents() 521 { 522 foreach($this->preload as $id) 523 $this->getComponent($id); 524 } 525 526 /** 527 * Preinitializes the module. 528 * This method is called at the beginning of the module constructor. |
#12 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/framework/base/CApplication.php(152): CModule->preloadComponents() 147 $this->initSystemHandlers(); 148 $this->registerCoreComponents(); 149 150 $this->configure($config); 151 $this->attachBehaviors($this->behaviors); 152 $this->preloadComponents(); 153 154 $this->init(); 155 } 156 157 |
#13 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/framework/YiiBase.php(125): CApplication->__construct("/home/admin3/web/foodtest.ru/public_html/info/protected/config/m...") 120 * to the constructor of the application class. 121 * @return mixed the application instance 122 */ 123 public static function createApplication($class,$config=null) 124 { 125 return new $class($config); 126 } 127 128 /** 129 * Returns the application singleton or null if the singleton has not been created yet. 130 * @return CApplication the application singleton, null if the singleton has not been created yet. |
#14 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/yii/framework/YiiBase.php(98): YiiBase::createApplication("CWebApplication", "/home/admin3/web/foodtest.ru/public_html/info/protected/config/m...") 093 * If not, the directory will be defaulted to 'protected'. 094 * @return CWebApplication 095 */ 096 public static function createWebApplication($config=null) 097 { 098 return self::createApplication('CWebApplication',$config); 099 } 100 101 /** 102 * Creates a console application instance. 103 * @param mixed $config application configuration. |
#15 |
+
–
/home/admin3/web/foodtest.ru/public_html/info/block.php(31): YiiBase::createWebApplication("/home/admin3/web/foodtest.ru/public_html/info/protected/config/m...") 26 // specify how many levels of call stack should be shown in each log message 27 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); 28 29 require_once($yii); 30 if (Yii::app() === null) 31 Yii::createWebApplication($config); 32 33 if ($_GET['r'] == 'site/block') 34 Yii::app()->clientScript->enableJavaScript = false; 35 36 |
#16 |
+
–
/home/admin3/web/foodtest.ru/public_html/comment_page.php(5): include("/home/admin3/web/foodtest.ru/public_html/info/block.php") 1 <?php 2 $_GET['r'] = 'pagecomment/index'; 3 $_GET['encode'] = 1; 4 $_GET['page_id'] = $_SERVER['REQUEST_URI']; 5 include $_SERVER['DOCUMENT_ROOT']."/info/block.php"; 6 ?> |
#17 |
+
–
/home/admin3/web/foodtest.ru/public_html/templates/footer.php(57): include("/home/admin3/web/foodtest.ru/public_html/comment_page.php") 52 strpos($_SERVER['PHP_SELF'], 'addcomment.php') == false && 53 strpos($_SERVER['PHP_SELF'], 'shoppreview.php') == false && 54 strpos($_SERVER['PHP_SELF'], 'writeshop.php') == false && 55 strpos($_SERVER['PHP_SELF'], 'writenew.php') == false && 56 strpos($_SERVER['PHP_SELF'], 'newpreview.php') == false) 57 include "comment_page.php"; ?> 58 </div> 59 <div id="recl"> 60 61 </div> 62 </div> |
#18 |
+
–
/home/admin3/web/foodtest.ru/public_html/zakon.php(43): include("/home/admin3/web/foodtest.ru/public_html/templates/footer.php") 38 39 </ul> 40 </div> 41 </div> 42 <? 43 include ("templates/footer.php"); 44 ?> 45 |