CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Connection refused

/var/www/textile_club/http/protected/components/Syncdata.php(17)

05  * Date: 14.11.2014
06  * Time: 14:45
07  */
08 
09 trait Syncdata {
10 
11     public $syncNew;
12 
13 
14     public $database = 'db';
15 
16     public function getDbConnection() {
17         return Yii::app()->{$this->database};
18     }
19 
20     public function syncInsert($db, $data) {
21         $params = [];
22         $list = $this->getTableSchema()->getColumnNames();
23 
24         foreach ($list as $key) {
25             if(in_array($key, $data))
26                 continue;
27             $params[$key]=$this->$key;
28         }
29 

Stack Trace

#4
+
 /var/www/textile_club/http/protected/components/Syncdata.php(17): CModule->__get("db")
12 
13 
14     public $database = 'db';
15 
16     public function getDbConnection() {
17         return Yii::app()->{$this->database};
18     }
19 
20     public function syncInsert($db, $data) {
21         $params = [];
22         $list = $this->getTableSchema()->getColumnNames();
#7
+
 /var/www/textile_club/http/protected/models/Items.php(141): CActiveRecord->findByAttributes(array("code" => "tolstovka_9096_21663", "active" => 1))
136         return parent::model($className);
137     }
138 
139     public static function getItemCard($code)
140     {
141         $item = self::model()->findByAttributes(['code' => $code, 'active' => 1]);
142         if ($item === null) {
143             return false;
144         }
145 
146         $result = [];
#8
+
 /var/www/textile_club/http/protected/controllers/SiteController.php(639): Items::getItemCard("tolstovka_9096_21663")
634 
635         if ($framed) {
636             $this->layout = 'card';
637         }
638 
639         if (!$data = Items::getItemCard($id)) {
640             throw new CHttpException(404, Yii::t('item', 'not_found'));
641         }
642 
643         $this->jsParams = $data;
644 
2024-03-29 11:02:21 nginx/1.20.1 Yii Framework/1.1.20