Magento - 编译后的警告消息

时间:2014-04-30 22:37:21

标签: magento

在Magento后端/管理界面编译后,在进入后端菜单项Sales - >时收到以下警告:订单(网站名称已替换为“...”:

  

警告:   包括(/家/.../的public_html /包括/ SRC / Klarna_KlarnaPaymentModule_Model_Order_status.php)   [function.include]:无法打开流:没有这样的文件或目录   在/home/.../public_html/includes/src/Varien_Autoload.php第93行。

显示此警告页面,而不是页面的预期/正常内容。禁用编译时,我不会收到此警告。

以下是Varien_Autoload的代码,其中包含提到的第93行(以return_include开头的行):

/**
 * Load class source code
 *
 * @param string $class
 */
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';
    //echo $classFile;die();
    return include $classFile;
}

这里是文件类Klarna_KlarnaPaymentModule_Model_Order_Status.php的内容:

类Klarna_KlarnaPaymentModule_Model_Order_Status     扩展Mage_Sales_Model_Order_Status {

const ACCEPTED = "klarna_accepted";
const PENDING = "klarna_pending";
const DENIED = "klarna_denied";

/**
 * Get status labels per store and hiding Klarna status for customers
 *
 * @return array Array of status labels
 */
public function getStoreLabels()
{
    $status = $this->getStatus();
    if ($status !== self::ACCEPTED
        && $status !== self::PENDING
        && $status !== self::DENIED
    ) {
        return parent::getStoreLabels();
    }

    $labels = array();
    $processing = Mage::getModel('sales/order_status')
        ->load(Mage_Sales_Model_Order::STATE_PROCESSING);

    foreach (Mage::app()->getStores() as $store) {
        $storeId = $store->getId();
        $labels[$storeId] = $processing->getStoreLabel($storeId);
    }

    return $labels;
}

}

我非常感谢采取哪些措施来解决这个问题。

0 个答案:

没有答案