在Magento中运行导出配置文件时出现致命错误

时间:2017-03-05 00:40:25

标签: php magento

当我在magento中运行导出所有产品配置文件时,我收到此错误:

  

致命错误:Class' Varien_Object_Cache'找不到   第312行/home/macweare/public_html/app/Mage.php

Image of the error

我已经刷新了Magento缓存和存储缓存,问题仍然存在。我在Magento 1.9.2.2

这是Mage.php文件中的假设错误

/**
 * Varien Objects Cache
 *
 * @param string $key optional, if specified will load this key
 * @return Varien_Object_Cache
 */
public static function objects($key = null)
{
    if (!self::$_objects) {
        self::$_objects = new Varien_Object_Cache;  // Line 312
    }
    if (is_null($key)) {
        return self::$_objects;
    } else {
        return self::$_objects->load($key);
    }
}

这是指向包含相关完整Mage.php文件的Pastebin的链接 - > Pastebin - Mage.php

1 个答案:

答案 0 :(得分:0)

更好更快的方法是自己调试Varien_Autoload->自动加载方法。

对方法自动加载进行垃圾修改

public function autoload($class)
{
    if ($this->_collectClasses) {
        $this->_arrLoadedClasses[self::$_scope][] = $class;
    }
    if ($this->_isIncludePathDefined) {
        $classFile =  COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . $class;
    } else {
        $classFile = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $class)));
    }
    $classFile.= '.php';
    // change start
    if($class == "Varien_Object_Cache") {
        echo $classFile; exit;
    }
    // change end
    //echo $classFile;die();
    return include $classFile;
}

在retrive' classFile'之后,检查文件是否存在。

相关问题