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] => 20
[module] => lgcookieslaw
[id_module] => 123
)
[1] => Array
(
[id_hook] => 20
[module] => ps_shoppingcart
[id_module] => 9
)
[2] => Array
(
[id_hook] => 20
[module] => ps_searchbar
[id_module] => 11
)
[3] => Array
(
[id_hook] => 20
[module] => leoblog
[id_module] => 80
)
[4] => Array
(
[id_hook] => 20
[module] => ps_facebook
[id_module] => 44
)
[5] => Array
(
[id_hook] => 20
[module] => leobootstrapmenu
[id_module] => 81
)
[6] => Array
(
[id_hook] => 20
[module] => leoslideshow
[id_module] => 82
)
[7] => Array
(
[id_hook] => 20
[module] => psxmarketingwithgoogle
[id_module] => 45
)
[8] => Array
(
[id_hook] => 20
[module] => ps_googleanalytics
[id_module] => 72
)
[9] => Array
(
[id_hook] => 20
[module] => leofeature
[id_module] => 83
)
[10] => Array
(
[id_hook] => 20
[module] => blockgrouptop
[id_module] => 84
)
[11] => Array
(
[id_hook] => 20
[module] => leoquicklogin
[id_module] => 85
)
[12] => Array
(
[id_hook] => 20
[module] => leoproductsearch
[id_module] => 86
)
[13] => Array
(
[id_hook] => 20
[module] => cardpay
[id_module] => 105
)
[14] => Array
(
[id_hook] => 20
[module] => shaim_cashondelivery
[id_module] => 107
)
[15] => Array
(
[id_hook] => 20
[module] => shaim_bankwire
[id_module] => 108
)
[16] => Array
(
[id_hook] => 20
[module] => shaim_baliknapostu
[id_module] => 109
)
[17] => Array
(
[id_hook] => 20
[module] => appagebuilder
[id_module] => 100
)
[18] => Array
(
[id_hook] => 20
[module] => shaim_zasilkovna_widget
[id_module] => 127
)
)
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] displayHeader
572. if (!isset($this->context->cart)) {
573. $this->context->cart = new Cart();
574. }
575.
576. $this->context->smarty->assign([
577. 'HOOK_HEADER' => Hook::exec('displayHeader'),
578. ]);
579. }
580.
581. public function initFooter()
582. {
Argument [0] displayHeader
121. /**
122. * {@inheritdoc}
123. */
124. public function initContent()
125. {
126. parent::initContent();
127.
128. if (
129. Validate::isLoadedObject($this->category)
130. && $this->category->active
131. && $this->category->checkAccess($this->context->customer->id)
314. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
315. $this->initHeader();
316. }
317.
318. if ($this->viewAccess()) {
319. $this->initContent();
320. } else {
321. $this->errors[] = $this->trans('Access denied.', [], 'Admin.Notifications.Error');
322. }
323.
324. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
505.
506. // Execute hook dispatcher
507. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
508.
509. // Running controller
510. $controller->run();
511.
512. // Execute hook dispatcher after
513. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher);
514. } catch (PrestaShopException $e) {
515. $e->displayMessage();
23. * @copyright Since 2007 PrestaShop SA and Contributors
24. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
25. */
26.
27. require dirname(__FILE__).'/config/config.inc.php';
28. Dispatcher::getInstance()->dispatch();