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 id_tab, class_name FROM `ps_4ftPiMT1_tab`
352. public static function getIdFromClassName($className)
353. {
354. $className = self::getClassName($className);
355. if (empty(self::$_getIdFromClassName)) {
356. self::$_getIdFromClassName = [];
357. $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT id_tab, class_name FROM `' . _DB_PREFIX_ . 'tab`', true, false);
358.
359. if (is_array($result)) {
360. foreach ($result as $row) {
361. self::$_getIdFromClassName[strtolower($row['class_name'])] = $row['id_tab'];
362. }
Argument [0] SELECT id_tab, class_name FROM `ps_4ftPiMT1_tab` Argument [1] 1 Argument [2]
69. //DONGND:: create tab array
70. $this->tabs = array(
71. array(
72. 'class_name' => 'AdminLeoQuickLoginModule',
73. 'name' => 'Leo Quick Login Configuration',
74. 'id_parent' => Tab::getIdFromClassName('AdminParentModulesSf'),
75. ),
76. );
77.
78. //DONGND:: create list type
79. $this->list_type = array(
Argument [0] adminparentmodulessf
118. if (count($args) > 0) {
119. return $refl->newInstanceArgs($args);
120. } else {
121. // newInstanceArgs with empty array fails in PHP 5.3 when the class
122. // doesn't have an explicitly defined constructor
123. return $refl->newInstance();
124. }
125. }
126.
127. private function doMake($serviceName, array $alreadySeen = [])
128. {
148. } elseif (!is_string($constructor)) {
149. // user already provided the value, no need to construct it.
150. $service = $constructor;
151. } else {
152. // assume the $constructor is a class name
153. $service = $this->makeInstanceFromClassName($constructor, $alreadySeen);
154. }
155.
156. if ($binding['shared']) {
157. $this->instances[$serviceName] = $service;
158. }
Argument [0]
leoquicklogin
Argument [1]
Array
(
[leoquicklogin] => 1
)
161. }
162. }
163.
164. public function make($serviceName)
165. {
166. return $this->doMake($serviceName, []);
167. }
168. }
Argument [0]
leoquicklogin
Argument [1]
Array
(
[leoquicklogin] => 1
)
65. {
66. if (null === self::$service_container) {
67. throw new CoreException('Service container is not set.');
68. }
69.
70. return self::$service_container->make($serviceName);
71. }
72. }
Argument [0] leoquicklogin
1227. $r = static::$_INSTANCE[$module_name] = ServiceLocator::get($override);
1228. }
1229. }
1230.
1231. if (!$r && class_exists($module_name, false)) {
1232. $r = static::$_INSTANCE[$module_name] = ServiceLocator::get($module_name);
1233. }
1234.
1235. return $r;
1236. }
1237.
Argument [0] leoquicklogin
1206. if (!isset(static::$_INSTANCE[$module_name])) {
1207. if (!Tools::file_exists_no_cache(_PS_MODULE_DIR_ . $module_name . '/' . $module_name . '.php')) {
1208. return false;
1209. }
1210.
1211. return Module::coreLoadModule($module_name);
1212. }
1213.
1214. return static::$_INSTANCE[$module_name];
1215. }
1216.
Argument [0] leoquicklogin
908. if (Validate::isLoadedObject($context->employee) && !Module::getPermissionStatic($hookRegistration['id_module'], 'view', $context->employee)) {
909. continue;
910. }
911. }
912.
913. if (!($moduleInstance = Module::getInstanceByName($hookRegistration['module']))) {
914. continue;
915. }
916.
917. if ($isRegistryEnabled) {
918. $hookRegistry->hookedByModule($moduleInstance);
Argument [0] leoquicklogin
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();