sadlyblue Posted July 9, 2013 Share Posted July 9, 2013 Hi, I'm trying to use cron jobs to set some things up and don't have to do them everyday. One example is the currency rate update, another is the search indexation, and a few modules/scripts i wrote myself. I found that include('config/config.inc.php'); doesn't work for me from cli (and a cron job). The script haults at this line, doesn't do anything, doesn't output an error, even after i turned display errors,... I could use wget, but it's not quite the same and it creates file in root. My only solution was to include('config/settings.inc.php'); and use PDO to access the database. Which is ok, but this way i can't use the built in functions/classes/... I reported on the currency update in http://forge.prestashop.com/browse/PSCFV-8879. The answer being it was fixed. Maybe it is, i haven't updated from 1.5.2. But cron_currency_rates.php is the same. And refreshCUrrencies seems the same in 1.5.4.1 Am i the only one with these problems? Has anyone found a solution? Thanks Link to comment Share on other sites More sharing options...
ScaleDEV Posted July 24, 2013 Share Posted July 24, 2013 I have the same bug. In PHP-CLI, this line doen't work correctly : // line 90 from config.inc.php $context->shop = Shop::initialize(); Link to comment Share on other sites More sharing options...
ScaleDEV Posted July 24, 2013 Share Posted July 24, 2013 (edited) I found the solution here : http://forge.prestashop.com/browse/PSCFV-9135 Edited July 24, 2013 by creaweb06 (see edit history) Link to comment Share on other sites More sharing options...
emokemi Posted July 27, 2013 Share Posted July 27, 2013 (edited) I found a simpler solution to this problem. In your script, just before you include the config.inc.php file, add the following define: define('_PS_ADMIN_DIR_', getcwd()); Problem solved! Edited July 27, 2013 by emokemi (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now