0
我有几个类(a,b,c等),它们扩展了一个名为mother的抽象类。所有的“儿子”使用方法“拯救”:日志的清理堆栈跟踪
<?php
class mother {
public function save() {
echo "Mother saves!\n";
debug_print_backtrace();
}
}
class a extends mother {
public function save() {
echo "Calling save from A\n";
parent::save();
}
}
$test = new a;
$test->save();
?>
如果你运行这段代码,debug_print_backtrace的结果是很干净,这正是我需要的:
#0 mother->save() called at [/home/xfiddlec/public_html/main/code_44364601.php:13] #1 a->save() called at [/home/xfiddlec/public_html/main/code_44364601.php:18]
的问题是,如果你正在使用框架(使用Zend2的Im),堆栈跟踪超过1MB,一个巨大的字符串。如果有办法我可以限制跟踪覆盖率?对于我的申请有文件,延长母亲的班级和班级的名字就够了。