从 deploy.php 文件加载旧版 PrestaShop 类

Load Legacy PrestaShop classes from deploy.php file

从我的 Prestashop 项目根目录中的 deploy.php 文件调用一个方法

    ModuleManagerBuilder::getInstance();

这又会调用其他 Legacy Prestashop 类,例如 Configuration 这会引发错误:

[Error] Class 'Configuration' not found

这个 Legacy PS 类 不使用命名空间语法,所以它就像自动加载不知道这个旧 类

只有从 /src 和 /tests 文件夹中的 类 调用 Legacy Class 时,PrestaShop 团队才努力解决问题,如下所述:https://github.com/PrestaShop/PrestaShop/blob/develop/autoload.php

如何让 deploy.php 知道这个 PrestaShop 旧版 类?

我想你只需要在你的文件中加载 config/config.inc.php