Php Prestashop安装错误-语言类上存在数组\u键\u参数
我想让Prestashop与Docker和Composer合作 我使用助手进行安装。此助手在模块安装部分出错Php Prestashop安装错误-语言类上存在数组\u键\u参数,php,prestashop,prestashop-1.6,Php,Prestashop,Prestashop 1.6,我想让Prestashop与Docker和Composer合作 我使用助手进行安装。此助手在模块安装部分出错 /install dev/index.php?installModules=true Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/classes/Language.php on line 645 Call Stack # Time Memory
/install dev/index.php?installModules=true
Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/classes/Language.php on line 645
Call Stack
# Time Memory Function Location
1 0.0002 251136 {main}( ) .../index.php:0
2 0.0163 2377856 InstallControllerHttp::execute( ) .../index.php:31
3 0.2252 4246288 InstallControllerHttpProcess->process( ) .../controllerHttp.php:173
4 0.2253 4246656 InstallControllerHttpProcess->processInstallModules( ) .../process.php:97
5 0.2591 9068744 InstallModelInstall->installModules( ) .../process.php:226
6 0.2636 9900216 ModuleCore::getInstanceByName( ) .../install.php:729
7 0.2636 9900664 ModuleCore::coreLoadModule( ) .../Module.php:1107
8 0.2651 10219816 Adapter_ServiceLocator::get( ) .../Module.php:1142
9 0.2651 10219816 Core_Foundation_IoC_Container->make( ) .../Adapter_ServiceLocator.php:52
10 0.2651 10219952 Core_Foundation_IoC_Container->doMake( ) .../Core_Foundation_IoC_Container.php:170
11 0.2651 10220832 Core_Foundation_IoC_Container->makeInstanceFromClassName( ) .../Core_Foundation_IoC_Container.php:157
12 0.2651 10221608 newInstance ( ) .../Core_Foundation_IoC_Container.php:124
13 0.2651 10222472 ThemeConfigurator->__construct( ) .../Core_Foundation_IoC_Container.php:124
14 0.2651 10227256 LanguageCore::getLanguage( ) .../themeconfigurator.php:43
15 0.2651 10227400 array_key_exists ( ) .../Language.php:645
错误来自此语言部分:
public static function getLanguage($id_lang)
{
if (!array_key_exists((int)$id_lang, self::$_LANGUAGES)) {
return false;
}
return self::$_LANGUAGES[(int)($id_lang)];
}
我没有别的东西,我不明白为什么self:$\u LANGUAGES
是null
我正在使用GitHub的最新1.6.1.4版本的PrestaShop
有人有类似的问题吗?谢谢你的帮助 我想他们忘了在
getLanguage()
方法中添加以下代码:
if(!self:$\u语言){
语言::加载语言();
}
此代码存在于方法getLanguages()
中:
公共静态函数getLanguages($active=true,$id\u shop=false,$ids\u only=false)
{
如果(!self::$\u语言){
语言::加载语言();
}
$languages=array();
foreach(self:$\u语言作为$language){
if($active&&!$language['active']||($id_-shop&&!isset($language['shops'][(int)$id_-shop])){
继续;
}
$languages[]=$id\u only?$language['id\u lang']:$language;
}
返回$语言;
}
但是getLanguage()
中缺少:
公共静态函数getLanguage($id\u lang)
{
如果(!array\u key\u存在((int)$id\u lang,self::$\u语言)){
返回false;
}
返回self::$_LANGUAGES[(int)($id_lang)];
}
对此不确定。我们在这里讨论的是供应商的prestashop代码。顺便说一句,如果我尝试安装相同的代码,但不是在Docker图像,这是工作。