Php 正在尝试获取Prestashop 1.6.1.11 Webox模块中非对象的属性

Php 正在尝试获取Prestashop 1.6.1.11 Webox模块中非对象的属性,php,json,object,Php,Json,Object,注意:试图在第354行的/home/../modules/webox/webox.php中获取非对象的属性 注意:试图在第393行的/home/…../webox/webox.php中获取非对象的属性 警告:为第393行/home/../webox/webox.php中的foreach()提供的参数无效 代码:346-414 346类WeboxClass{ 347公共$total_count=0 public $json; public function __construct($json =

注意:试图在第354行的/home/../modules/webox/webox.php中获取非对象的属性

注意:试图在第393行的/home/…../webox/webox.php中获取非对象的属性

警告:为第393行/home/../webox/webox.php中的foreach()提供的参数无效


代码:346-414

346类WeboxClass{

347公共$total_count=0

public $json;
public function __construct($json = "") {
    if(strlen($json) == 0){
        $json = $this->downloadAutomatakAndReturn();
    }
    $this->json = json_decode($json);
354$this->total_count=$this->json->total_count;}

public function downloadAutomatakAndReturn(){
    $tmp_dir = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : (is_callable('sys_get_temp_dir') ? sys_get_temp_dir() : '');

    if (!is_file($tmp_dir.'/validboltlista.json') || filemtime($tmp_dir.'/validboltlista.json')+86400<time()) {
        $jsonData=file_get_contents('https://api-hu.easypack24.net/v4/machines?type=0');
        file_put_contents($tmp_dir.'/validboltlista.json', $jsonData, LOCK_EX);
}else{
        $jsonData=file_get_contents($tmp_dir.'/validboltlista.json');
    }
    return $jsonData;
}

function getAllAutomataAsOptions($selectedAutomata){
    $result = "";
    $automatak = array();
    foreach($this->getAutomatakByTelepules("") as $automata){
        /* @var $automata WeboxItem */
        $cim = $automata->getAddress_city() . " " . $automata->getAddress_post_code() . ", " . $automata->getAddress_street() . " " . $automata->getAddress_building_no();
        $automatak[$automata->getId()] = array(
            'text' => $cim . " (" . $automata->getId() . ")", 
            'id' => $automata->getId(), 
            'map' => $automata->getMinimap(), 
            'info' => $automata->getLocation_description()
        );
    }
    sort($automatak);
    foreach($automatak as $s){
        $selected = (strlen($selectedAutomata) > 1 && $s['id'] == $selectedAutomata ? "selected='selected'" : "");
        $result .=  "<option value='".$s['id']."' data-map='".$s['map']."' data-info='".$s['info']."' ".$selected.">".$s['text']."</option>\n";
    }
    return $result;

}

function getAutomatakByTelepules($telepules){
    $result = array();
}代码是正确的

问题出在服务器上。我已经在另一台服务器上安装了prestashop和webox插件。有人在工作

但问题不在于php.ini文件和htaccess文件。我已将所有文件从一台服务器复制到另一台服务器,但没有解决问题


代码是正确的。

您有问题吗?对不起,我有一个问题:解决方案是什么?网页前面的debub注意:注意:在第354行尝试获取/home/../modules/webox/webox.php中的非对象属性注意:在第393行尝试获取/home/../webox/webox.php中的非对象属性警告:为foreach()提供的参数无效在第393行的/home/……../webox/webox.php中
        if($json->address->city == $telepules || strlen($telepules) == 0){
            $result[$id] = new WeboxItem($json);
        }
    }
    return $result;
}

function getAutomataByID($id){
    foreach($this->json->_embedded->machines as $id => $json){
        if($json->id == $id){
            return @new WeboxItem($json);
        }
    }
    return null;
}

function getTotalCount() {
    return $this->total_count;
}