Link to database cannot be established: SQLSTATE[HY000] [2002] No such file or directory
at line 127 in file classes/db/DbPDO.php
122. public function connect()
123. {
124. try {
125. $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5);
126. } catch (PDOException $e) {
127. throw new PrestaShopException('Link to database cannot be established: ' . $e->getMessage());
128. }
129.
130. $this->link->exec('SET SESSION sql_mode = \'\'');
131.
132. return $this->link;
374. }
375.
376. $this->result = $this->_query($sql);
377.
378. if (!$this->result && $this->getNumberError() == 2006) {
379. if ($this->connect()) {
380. $this->result = $this->_query($sql);
381. }
382. }
383.
384. if (_PS_DEBUG_SQL_) {
608. }
609.
610. return $this->execute($sql, $use_cache);
611. }
612.
613. $this->result = $this->query($sql);
614.
615. if (!$this->result) {
616. $result = false;
617. } else {
618. if (!$array) {
72. $sql = "SELECT cb.`id_link_block`
73. FROM {$this->db_prefix}link_block cb
74. WHERE `id_hook` = $id_hook
75. ORDER by cb.`position`
76. ";
77. $ids = $this->db->executeS($sql);
78.
79. $cmsBlock = array();
80. foreach ($ids as $id) {
81. $cmsBlock[] = new LinkBlock((int) $id['id_link_block']);
82. }
229.
230. public function getWidgetVariables($hookName, array $configuration)
231. {
232. $id_hook = Hook::getIdByName($hookName);
233.
234. $linkBlocks = $this->legacyBlockRepository->getByIdHook($id_hook);
235.
236. $blocks = array();
237. foreach ($linkBlocks as $block) {
238. $blocks[] = $this->linkBlockPresenter->present($block);
239. }
219. public function renderWidget($hookName, array $configuration)
220. {
221. $key = 'ps_linklist|' . $hookName;
222.
223. if (!$this->isCached($this->templateFile, $this->getCacheId($key))) {
224. $this->smarty->assign($this->getWidgetVariables($hookName, $configuration));
225. }
226.
227. return $this->fetch($this->templateFile, $this->getCacheId($key));
228. }
229.
970. return $module->{$method}($params);
971. }
972.
973. public static function coreRenderWidget($module, $hook_name, $params)
974. {
975. return $module->renderWidget($hook_name, $params);
976. }
977.
978. /**
979. * @return \PrestaShopBundle\DataCollector\HookRegistry|null
980. */
922. if ($moduleInstance instanceof WidgetInterface) {
923. if (0 !== $key && true === $chain) {
924. $hook_args = $output;
925. }
926.
927. $display = Hook::coreRenderWidget($moduleInstance, $hook_name, $hook_args);
928.
929. if ($array_return) {
930. $output[$moduleInstance->name] = $display;
931. } else {
932. if (true === $chain) {
158.
159. return $result;
160. }
161. unset($hook_params['h']);
162.
163. return Hook::exec($params['h'], $hook_params, $id_module);
164. }
165.
166. function smartyCleanHtml($data)
167. {
168. // Prevent xss injection.
78. } else {
79. $args[] = &$arguments[$a];
80. }
81. }
82.
83. return call_user_func_array($item, $args);
84. }
85. }
86.
87. public static function getInstance($smarty)
88. {
96. ),
97. );
98. public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
99. ?>
100.
101. <?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0], array( array('h'=>'displayFooter'),$_smarty_tpl ) );?>
102.
103. <?php
104. }
105. }
106. /* {/block 'hook_footer'} */
243. */
244. public function callBlock(Smarty_Internal_Block $block, Smarty_Internal_Template $tpl)
245. {
246. $this->sourceStack[] = $tpl->source;
247. $tpl->source = $this->sources[ $block->tplIndex ];
248. $block->callBlock($tpl);
249. $tpl->source = array_pop($this->sourceStack);
250. }
251. }
179. $block->parent = $parent;
180. if ($block->append && !$block->prepend && isset($parent)) {
181. $this->callParent($tpl, $block, '\'{block append}\'');
182. }
183. if ($block->callsChild || !isset($block->child) || ($block->child->hide && !isset($block->child->child))) {
184. $this->callBlock($block, $tpl);
185. } else {
186. $this->process($tpl, $block->child, $block);
187. }
188. if ($block->prepend && isset($parent)) {
189. $this->callParent($tpl, $block, '{block prepend}');
151. }
152. // make sure we got child block of child template of current block
153. while ($block->child && $block->tplIndex <= $block->child->tplIndex) {
154. $block->child = $block->child->child;
155. }
156. $this->process($tpl, $block);
157. }
158.
159. /**
160. * Goto child block or render this
161. *
38. </div>
39. <div class="footer-container">
40. <div class="container">
41. <div class="row">
42. <?php
43. $_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_125631826568ba324a6e2400_37711053', 'hook_footer');
44. ?>
45.
46. </div>
47. </div>
48. <div class="footer-bottom hb-animate-element bottom-to-top">
118. if ($_template->startRenderCallbacks) {
119. foreach ($_template->startRenderCallbacks as $callback) {
120. call_user_func($callback, $_template);
121. }
122. }
123. $unifunc($_template);
124. foreach ($_template->endRenderCallbacks as $callback) {
125. call_user_func($callback, $_template);
126. }
127. $_template->isRenderingCache = false;
128. } catch (Exception $e) {
109. array_merge($_template->cached->file_dependency, $this->file_dependency);
110. }
111. if ($_template->source->handler->uncompiled) {
112. $_template->source->handler->renderUncompiled($_template->source, $_template);
113. } else {
114. $this->getRenderedTemplateCode($_template);
115. }
116. if ($_template->caching && $this->has_nocache_code) {
117. $_template->cached->hashes[ $this->nocache_hash ] = true;
118. }
119. if ($_template->smarty->debugging) {
211. $this->cached->render($this, $no_output_filter);
212. } else {
213. if (!isset($this->compiled) || $this->compiled->compile_id !== $this->compile_id) {
214. $this->loadCompiled(true);
215. }
216. $this->compiled->render($this);
217. }
218. // display or fetch
219. if ($display) {
220. if ($this->caching && $this->smarty->cache_modified_check) {
221. $this->smarty->ext->_cacheModify->cacheModifiedCheck(
380. }
381. } else {
382. if (isset($tpl->compiled)) {
383. $tpl->compiled->render($tpl);
384. } else {
385. $tpl->render();
386. }
387. }
388. }
389.
390. /**
342. ),
343. );
344. public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
345. ?>
346.
347. <?php $_smarty_tpl->_subTemplateRender("file:_partials/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
348. ?>
349. <?php
350. }
351. }
352. /* {/block "footer"} */
243. */
244. public function callBlock(Smarty_Internal_Block $block, Smarty_Internal_Template $tpl)
245. {
246. $this->sourceStack[] = $tpl->source;
247. $tpl->source = $this->sources[ $block->tplIndex ];
248. $block->callBlock($tpl);
249. $tpl->source = array_pop($this->sourceStack);
250. }
251. }
179. $block->parent = $parent;
180. if ($block->append && !$block->prepend && isset($parent)) {
181. $this->callParent($tpl, $block, '\'{block append}\'');
182. }
183. if ($block->callsChild || !isset($block->child) || ($block->child->hide && !isset($block->child->child))) {
184. $this->callBlock($block, $tpl);
185. } else {
186. $this->process($tpl, $block->child, $block);
187. }
188. if ($block->prepend && isset($parent)) {
189. $this->callParent($tpl, $block, '{block prepend}');
151. }
152. // make sure we got child block of child template of current block
153. while ($block->child && $block->tplIndex <= $block->child->tplIndex) {
154. $block->child = $block->child->child;
155. }
156. $this->process($tpl, $block);
157. }
158.
159. /**
160. * Goto child block or render this
161. *
108. </div>
109. <?php }?>
110.
111. <footer id="footer">
112. <?php
113. $_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_197612415168ba324a3be004_00175175', "footer");
114. ?>
115.
116. </footer>
117.
118. </main>
118. if ($_template->startRenderCallbacks) {
119. foreach ($_template->startRenderCallbacks as $callback) {
120. call_user_func($callback, $_template);
121. }
122. }
123. $unifunc($_template);
124. foreach ($_template->endRenderCallbacks as $callback) {
125. call_user_func($callback, $_template);
126. }
127. $_template->isRenderingCache = false;
128. } catch (Exception $e) {
109. array_merge($_template->cached->file_dependency, $this->file_dependency);
110. }
111. if ($_template->source->handler->uncompiled) {
112. $_template->source->handler->renderUncompiled($_template->source, $_template);
113. } else {
114. $this->getRenderedTemplateCode($_template);
115. }
116. if ($_template->caching && $this->has_nocache_code) {
117. $_template->cached->hashes[ $this->nocache_hash ] = true;
118. }
119. if ($_template->smarty->debugging) {
211. $this->cached->render($this, $no_output_filter);
212. } else {
213. if (!isset($this->compiled) || $this->compiled->compile_id !== $this->compile_id) {
214. $this->loadCompiled(true);
215. }
216. $this->compiled->render($this);
217. }
218. // display or fetch
219. if ($display) {
220. if ($this->caching && $this->smarty->cache_modified_check) {
221. $this->smarty->ext->_cacheModify->cacheModifiedCheck(
380. }
381. } else {
382. if (isset($tpl->compiled)) {
383. $tpl->compiled->render($tpl);
384. } else {
385. $tpl->render();
386. }
387. }
388. }
389.
390. /**
111. }
112. if (isset($template) && (($tpl->parent->_isTplObj() && $tpl->parent->source->type !== 'extends')
113. || $tpl->smarty->extends_recursion)
114. ) {
115. $tpl->_subTemplateRender(
116. $template,
117. $tpl->cache_id,
118. $tpl->compile_id,
119. $tpl->caching ? 9999 : 0,
120. $tpl->cache_lifetime,
121. array(),
33.
34. <?php
35. $_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_38088209768ba324a39e162_66638262', 'content_wrapper');
36. ?>
37.
38. <?php $_smarty_tpl->inheritance->endChild($_smarty_tpl, 'layouts/layout-both-columns.tpl');
39. }
40. /* {block 'right_column'} */
41. class Block_148888440768ba324a39d863_26447357 extends Smarty_Internal_Block
42. {
43. public $subBlocks = array (
118. if ($_template->startRenderCallbacks) {
119. foreach ($_template->startRenderCallbacks as $callback) {
120. call_user_func($callback, $_template);
121. }
122. }
123. $unifunc($_template);
124. foreach ($_template->endRenderCallbacks as $callback) {
125. call_user_func($callback, $_template);
126. }
127. $_template->isRenderingCache = false;
128. } catch (Exception $e) {
109. array_merge($_template->cached->file_dependency, $this->file_dependency);
110. }
111. if ($_template->source->handler->uncompiled) {
112. $_template->source->handler->renderUncompiled($_template->source, $_template);
113. } else {
114. $this->getRenderedTemplateCode($_template);
115. }
116. if ($_template->caching && $this->has_nocache_code) {
117. $_template->cached->hashes[ $this->nocache_hash ] = true;
118. }
119. if ($_template->smarty->debugging) {
211. $this->cached->render($this, $no_output_filter);
212. } else {
213. if (!isset($this->compiled) || $this->compiled->compile_id !== $this->compile_id) {
214. $this->loadCompiled(true);
215. }
216. $this->compiled->render($this);
217. }
218. // display or fetch
219. if ($display) {
220. if ($this->caching && $this->smarty->cache_modified_check) {
221. $this->smarty->ext->_cacheModify->cacheModifiedCheck(
380. }
381. } else {
382. if (isset($tpl->compiled)) {
383. $tpl->compiled->render($tpl);
384. } else {
385. $tpl->render();
386. }
387. }
388. }
389.
390. /**
111. }
112. if (isset($template) && (($tpl->parent->_isTplObj() && $tpl->parent->source->type !== 'extends')
113. || $tpl->smarty->extends_recursion)
114. ) {
115. $tpl->_subTemplateRender(
116. $template,
117. $tpl->cache_id,
118. $tpl->compile_id,
119. $tpl->caching ? 9999 : 0,
120. $tpl->cache_lifetime,
121. array(),
32.
33. <?php
34. $_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_181502492368ba324a3856d5_47747029', 'content');
35. ?>
36.
37. <?php $_smarty_tpl->inheritance->endChild($_smarty_tpl, $_smarty_tpl->tpl_vars['layout']->value);
38. }
39. /* {block 'product_list_header'} */
40. class Block_184613567868ba324a385dd9_01830854 extends Smarty_Internal_Block
41. {
42. public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
118. if ($_template->startRenderCallbacks) {
119. foreach ($_template->startRenderCallbacks as $callback) {
120. call_user_func($callback, $_template);
121. }
122. }
123. $unifunc($_template);
124. foreach ($_template->endRenderCallbacks as $callback) {
125. call_user_func($callback, $_template);
126. }
127. $_template->isRenderingCache = false;
128. } catch (Exception $e) {
109. array_merge($_template->cached->file_dependency, $this->file_dependency);
110. }
111. if ($_template->source->handler->uncompiled) {
112. $_template->source->handler->renderUncompiled($_template->source, $_template);
113. } else {
114. $this->getRenderedTemplateCode($_template);
115. }
116. if ($_template->caching && $this->has_nocache_code) {
117. $_template->cached->hashes[ $this->nocache_hash ] = true;
118. }
119. if ($_template->smarty->debugging) {
211. $this->cached->render($this, $no_output_filter);
212. } else {
213. if (!isset($this->compiled) || $this->compiled->compile_id !== $this->compile_id) {
214. $this->loadCompiled(true);
215. }
216. $this->compiled->render($this);
217. }
218. // display or fetch
219. if ($display) {
220. if ($this->caching && $this->smarty->cache_modified_check) {
221. $this->smarty->ext->_cacheModify->cacheModifiedCheck(
380. }
381. } else {
382. if (isset($tpl->compiled)) {
383. $tpl->compiled->render($tpl);
384. } else {
385. $tpl->render();
386. }
387. }
388. }
389.
390. /**
111. }
112. if (isset($template) && (($tpl->parent->_isTplObj() && $tpl->parent->source->type !== 'extends')
113. || $tpl->smarty->extends_recursion)
114. ) {
115. $tpl->_subTemplateRender(
116. $template,
117. $tpl->cache_id,
118. $tpl->compile_id,
119. $tpl->caching ? 9999 : 0,
120. $tpl->cache_lifetime,
121. array(),
33.
34. <?php
35. $_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_24005556568ba324a36db87_23445008', 'product_list_description');
36. ?>
37.
38. <?php $_smarty_tpl->inheritance->endChild($_smarty_tpl, 'catalog/listing/product-list.tpl');
39. }
40. /* {block 'product_list_header'} */
41. class Block_49017987768ba324a36cee5_90386777 extends Smarty_Internal_Block
42. {
43. public $subBlocks = array (
118. if ($_template->startRenderCallbacks) {
119. foreach ($_template->startRenderCallbacks as $callback) {
120. call_user_func($callback, $_template);
121. }
122. }
123. $unifunc($_template);
124. foreach ($_template->endRenderCallbacks as $callback) {
125. call_user_func($callback, $_template);
126. }
127. $_template->isRenderingCache = false;
128. } catch (Exception $e) {
109. array_merge($_template->cached->file_dependency, $this->file_dependency);
110. }
111. if ($_template->source->handler->uncompiled) {
112. $_template->source->handler->renderUncompiled($_template->source, $_template);
113. } else {
114. $this->getRenderedTemplateCode($_template);
115. }
116. if ($_template->caching && $this->has_nocache_code) {
117. $_template->cached->hashes[ $this->nocache_hash ] = true;
118. }
119. if ($_template->smarty->debugging) {
211. $this->cached->render($this, $no_output_filter);
212. } else {
213. if (!isset($this->compiled) || $this->compiled->compile_id !== $this->compile_id) {
214. $this->loadCompiled(true);
215. }
216. $this->compiled->render($this);
217. }
218. // display or fetch
219. if ($display) {
220. if ($this->caching && $this->smarty->cache_modified_check) {
221. $this->smarty->ext->_cacheModify->cacheModifiedCheck(
227. ob_start();
228. $template->_mergeVars();
229. if (!empty(Smarty::$global_tpl_vars)) {
230. $template->tpl_vars = array_merge(Smarty::$global_tpl_vars, $template->tpl_vars);
231. }
232. $result = $template->render(false, $function);
233. $template->_cleanUp();
234. if ($saveVars) {
235. $template->tpl_vars = $savedTplVars;
236. $template->config_vars = $savedConfigVars;
237. } else {
111. * @throws SmartyException
112. * @return string rendered template output
113. */
114. public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null)
115. {
116. $result = $this->_execute($template, $cache_id, $compile_id, $parent, 0);
117. return $result === null ? ob_get_clean() : $result;
118. }
119.
120. /**
121. * displays a Smarty template
107. */
108. public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
109. {
110. $this->check_compile_cache_invalidation();
111.
112. return parent::fetch($template, $cache_id, $compile_id, $parent, $display, $merge_tpl_vars, $no_output_filter);
113. }
114.
115. /**
116. * {@inheritdoc}
117. */
678. if (is_array($content)) {
679. foreach ($content as $tpl) {
680. $html .= $this->context->smarty->fetch($tpl, null, $this->getLayout());
681. }
682. } else {
683. $html = $this->context->smarty->fetch($content, null, $this->getLayout());
684. }
685.
686. Hook::exec('actionOutputHTMLBefore', array('html' => &$html));
687. echo trim($html);
688. }
35. $html = ob_get_contents();
36. ob_clean();
37. Hook::exec('actionOutputHTMLBefore', array('html' => &$html));
38. echo $html;
39. } else
40. return parent::smartyOutputContent($content);
41. }
42. }662. 'javascript' => $this->getJavascript(),
663. 'js_custom_vars' => Media::getJsDef(),
664. 'notifications' => $this->prepareNotifications(),
665. ));
666.
667. $this->smartyOutputContent($this->template);
668.
669. return true;
670. }
671.
672. protected function smartyOutputContent($content)
307. $this->{'displayAjax' . $action}();
308. } elseif (method_exists($this, 'displayAjax')) {
309. $this->displayAjax();
310. }
311. } else {
312. $this->display();
313. }
314. } else {
315. $this->initCursedPage();
316. $this->smartyOutputContent($this->layout);
317. }
510. if (isset($params_hook_action_dispatcher)) {
511. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
512. }
513.
514. // Running controller
515. $controller->run();
516.
517. // Execute hook dispatcher after
518. if (isset($params_hook_action_dispatcher)) {
519. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher);
520. }
23. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
24. * International Registered Trademark & Property of PrestaShop SA
25. */
26.
27. require dirname(__FILE__).'/config/config.inc.php';
28. Dispatcher::getInstance()->dispatch();