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);
605. // This method must be used only with queries which display results
606. if (!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc|checksum)\s#i', $sql)) {
607. throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
608. }
609.
610. $this->result = $this->query($sql);
611.
612. if (!$this->result) {
613. $result = false;
614. } else {
615. if (!$array) {
Argument [0] SELECT a.`id_lgcookieslaw_purpose`, a.`locked_modules` FROM `ps_4ftPiMT1_lgcookieslaw_purpose` a WHERE (a.`id_shop` = 1) AND (a.`active` = 1)
406.
407. if ($active) {
408. $query->where('a.`active` = ' . (int) $active);
409. }
410.
411. return Db::getInstance()->executeS($query);
412. }
413.
414. public function deleteAssociatedCookies()
415. {
416. $lgcookieslaw_cookies = LGCookiesLawCookie::getCookiesByPurpose((int) $this->id, null, (int) $this->id_shop);
Argument [0] SELECT a.`id_lgcookieslaw_purpose`, a.`locked_modules` FROM `ps_4ftPiMT1_lgcookieslaw_purpose` a WHERE (a.`id_shop` = 1) AND (a.`active` = 1)
5607.
5608. $lgcookieslaw_accepted_purposes = !empty($lgcookieslaw_cookie_values->lgcookieslaw_accepted_purposes) ?
5609. implode(',', $lgcookieslaw_cookie_values->lgcookieslaw_accepted_purposes) : null;
5610.
5611. $lgcookieslaw_purposes_locked_modules =
5612. LGCookiesLawPurpose::getLockedModules($lgcookieslaw_accepted_purposes);
5613.
5614. $lgcookieslaw_all_locked_modules = [];
5615.
5616. if (!empty($lgcookieslaw_purposes_locked_modules)) {
5617. foreach ($lgcookieslaw_purposes_locked_modules as $lgcookieslaw_purpose_locked_modules) {
Argument [0]
15. if (!empty($modules_to_invoke)
16. && Module::isInstalled('lgcookieslaw')
17. && Module::isEnabled('lgcookieslaw')
18. ) {
19. $lgcookieslaw = Module::getInstanceByName('lgcookieslaw');
20. $modules_to_invoke = $lgcookieslaw->getHookModuleExecList($modules_to_invoke);
21. }
22. return $modules_to_invoke;
23. }
24. }
Argument [0]
Array
(
[0] => Array
(
[id_hook] => 28
[module] => ps_googleanalytics
[id_module] => 72
)
[1] => Array
(
[id_hook] => 28
[module] => statsdata
[id_module] => 74
)
[2] => Array
(
[id_hook] => 28
[module] => leofeature
[id_module] => 83
)
[3] => Array
(
[id_hook] => 28
[module] => leoquicklogin
[id_module] => 85
)
[4] => Array
(
[id_hook] => 28
[module] => lgcookieslaw
[id_module] => 123
)
)
798. throw new PrestaShopException('Invalid id_module or hook_name');
799. }
800.
801. // If no modules associated to hook_name or recompatible hook name, we stop the function
802.
803. if (!$module_list = Hook::getHookModuleExecList($hook_name)) {
804. if ($isRegistryEnabled) {
805. $hookRegistry->collect();
806. }
807.
808. return ($array_return) ? [] : '';
Argument [0] displayBeforeBodyClosingTag
182.
183. return $result;
184. }
185. unset($hook_params['h']);
186.
187. return Hook::exec($params['h'], $hook_params, $id_module);
188. }
189.
190. function smartyCleanHtml($data)
191. {
192. // Prevent xss injection.
Argument [0] displayBeforeBodyClosingTag Argument [1]