Search code examples
phpprestashopautoloadprestashop-1.7legacy-code

Load Legacy PrestaShop classes from deploy.php file


From deploy.php file in the root of my Prestashop project I call a method

    ModuleManagerBuilder::getInstance();

that in turn calls other Legacy Prestashop classes like Configuration This throw an error:

[Error] Class 'Configuration' not found

This Legacy PS classes doesn't use namespace syntax so it is like the autoload is not aware of this old classes

The PrestaShop team worked to solve the problem only if the Legacy Class is called from classes in /src and /tests folder like explained here: https://github.com/PrestaShop/PrestaShop/blob/develop/autoload.php

How can I make deploy.php aware of this PrestaShop Legacy classes?


Solution

  • I think all you need is to load config/config.inc.php in your file