Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused
at line 119 in file classes/db/DbPDO.php
114. public function connect()
115. {
116. try {
117. $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5);
118. } catch (PDOException $e) {
119. throw new PrestaShopException('Link to database cannot be established: ' . $e->getMessage());
120. }
121.
122. $this->link->exec('SET SESSION sql_mode = \'\'');
123.
124. return $this->link;
375. }
376.
377. $this->result = $this->_query($sql);
378.
379. if (!$this->result && $this->getNumberError() == 2006) {
380. $this->connect();
381. $this->result = $this->_query($sql);
382. }
383.
384. if (_PS_DEBUG_SQL_) {
385. $this->displayError($sql);
655.
656. return $result;
657. }
658. }
659.
660. $this->result = $this->query($sql);
661. if (!$this->result) {
662. $result = false;
663. } else {
664. $result = $this->nextRow($this->result);
665. }
Argument [0] SELECT `id_module` FROM `ps_4ftPiMT1_module` WHERE `name` = "ps_categorytree" LIMIT 1
689. {
690. if ($sql instanceof DbQuery) {
691. $sql = $sql->build();
692. }
693.
694. $result = $this->getRow($sql, $use_cache);
695. if (false === $result) {
696. return false;
697. }
698.
699. return array_shift($result);
Argument [0] SELECT `id_module` FROM `ps_4ftPiMT1_module` WHERE `name` = "ps_categorytree" LIMIT 1 Argument [1] 1
2628. */
2629. public static function getModuleIdByName($name)
2630. {
2631. $cache_id = 'Module::getModuleIdByName_' . pSQL($name);
2632. if (!Cache::isStored($cache_id)) {
2633. $result = (int) Db::getInstance()->getValue('SELECT `id_module` FROM `' . _DB_PREFIX_ . 'module` WHERE `name` = "' . pSQL($name) . '"');
2634. Cache::store($cache_id, $result);
2635.
2636. return $result;
2637. }
2638.
Argument [0] SELECT `id_module` FROM `ps_4ftPiMT1_module` WHERE `name` = "ps_categorytree"
2100.
2101. public static function isEnabled($module_name)
2102. {
2103. if (!Cache::isStored('Module::isEnabled' . $module_name)) {
2104. $active = false;
2105. $id_module = Module::getModuleIdByName($module_name);
2106. if (Db::getInstance()->getValue('SELECT `id_module` FROM `' . _DB_PREFIX_ . 'module_shop` WHERE `id_module` = ' . (int) $id_module . ' AND `id_shop` = ' . (int) Context::getContext()->shop->id)) {
2107. $active = true;
2108. }
2109. Cache::store('Module::isEnabled' . $module_name, (bool) $active);
2110.
Argument [0] ps_categorytree
994. }
995.
996. public static function coreRenderWidget($module, $hook_name, $params)
997. {
998. $context = Context::getContext();
999. if (!Module::isEnabled($module->name) || $context->isMobile() && !Module::isEnabledForMobileDevices($module->name)) {
1000. return null;
1001. }
1002.
1003. try {
1004. return $module->renderWidget($hook_name, $params);
Argument [0] ps_categorytree
943. if ($moduleInstance instanceof WidgetInterface) {
944. if (0 !== $key && true === $chain) {
945. $hook_args = $output;
946. }
947.
948. $display = Hook::coreRenderWidget($moduleInstance, $registeredHookName, $hook_args);
949.
950. if ($array_return) {
951. $output[$moduleInstance->name] = $display;
952. } else {
953. if (true === $chain) {
Argument [0]