Db::Instance prestashop

二次信任 提交于 2019-12-24 17:32:59

问题


I added config.inc.php inside my php script in order to access to Db class provided.

The problem is that when I launch the script from the server, it redicted to the website prestashop and then I can't see what I want to echo in the html page.

More, I have made a error in order to see the behaviour: nothing is shown, he redirect to the prestashop website.

Please help me.


回答1:


SOLVED

After lots of tests, the soloution is very easy.

In order to use class from Prestashop service in my_own_file.php, we have to include

  • config.inc.php located inside config directory
  • init.php located at the root of the store

But, to reach this two includes, my_own_file.php has to be at the root of the prestashop store directory or inside it.

The reason is that, to access to prestashop store files, the file has to be part of the store also. Otherwise, you don't have the permission and your sever loads index.php .



来源:https://stackoverflow.com/questions/43712311/dbinstance-prestashop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!