Algirdas Posted May 28, 2015 Share Posted May 28, 2015 Hello, I'm working with Prestashop for a while. At the moment I'm making XML import module.I made xmlimport.php class and it works fine, but after I created new file to handle cron job tasks Prestashop started to throw me errors: 2 errors xmlimport (parse error in /modules/xmlimport/xmlimport.php) xmlimport (class missing in /modules/xmlimport/xmlimport.php) If I comment this: require _PS_MODULE_DIR_.'xmlimport/vendor/autoload.php'; use Prewk\XmlStringStreamer; use Prewk\XmlStringStreamer\Stream; use Prewk\XmlStringStreamer\Parser; then Prestashop don't show errors anymore. One more time, if I add my module to fresh installed Prestashop everything works fine, but after I create new file (cron.php) Prestashop starts showing me that error. cron.php content: <?php include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/xmlimport.php'); if (substr(Tools::encrypt('crone/index'),0,10) != Tools::getValue('token') || !Module::isInstalled('xmlimport')) die('Bad token'); echo "Testing"; Link to comment Share on other sites More sharing options...
nghiadoan Posted May 29, 2015 Share Posted May 29, 2015 i have the same problem T_T Link to comment Share on other sites More sharing options...
Algirdas Posted May 29, 2015 Author Share Posted May 29, 2015 Still don't find any solution. To my mind, it's something with namespaces, because by default Prestashop don't use them. Link to comment Share on other sites More sharing options...
Algirdas Posted May 29, 2015 Author Share Posted May 29, 2015 Some more details, in Model.php I added: var_dump(eval('if (false){ '.$file.' }') !== false); var_dump return: Parse error: syntax error, unexpected 'private' (T_PRIVATE) in /var/www/html/prestashop/classes/module/Module.php(1243) : eval()'d code on line 1 bool(false) At the moment xmlimport.php content: <?php class XmlImport extends Module { //empty class } ?> So where eval see "private"? Really, wtf? Link to comment Share on other sites More sharing options...
softhightech Posted March 29, 2017 Share Posted March 29, 2017 yeah i also have same probleme syntax error, unexpected 'use' (T_USE) 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