(我目前没有安装 1.4.0.1,但我认为这几乎都是一样的)
对此没有配置设置。您需要自定义代码来实现这一点(假设政治/能力/预算阻止了明显的解决方案,即修复错误)。
这些错误是在一段 Magento 代码调用时产生的
Mage::printException($e);
这个方法,最终是report.php文件中的requires。
public static function printException(Exception $e, $extra = '')
{
//...snip...
require_once(self::getBaseDir() . DS . 'errors' . DS . 'report.php');
}
而report.php 包含以下内容
#File: errors/report.php
require_once 'processor.php';
$processor = new Error_Processor();
if (isset($reportData) && is_array($reportData)) {
$processor->saveReport($reportData);
}
$processor->processReport();
这是对saveReport 的调用,它保存了让您烦恼的文件
public function saveReport($reportData)
{
$this->reportData = $reportData;
$this->reportId = abs(intval(microtime(true) * rand(100, 1000)));
$this->_reportFile = $this->_reportDir . '/' . $this->reportId;
//...snip...
@file_put_contents($this->_reportFile, serialize($reportData));
//...snip...
}
在这个执行链中没有任何地方(我保证即使是在被截断的代码中)也没有在写入文件或调用printException 之前检查配置的条件代码。这意味着实现您想要的唯一方法是手动修改文件。
如何由你决定,如果是我,我会注释掉 file_put_contents 行。
#@file_put_contents($this->_reportFile, serialize($reportData));
这是单行更改,但商店的现有行为保持不变。
说了这么多——真正的解决方案是修复错误。