如何获取访问方法的行?
方法:
function configure($newFile = false){
try {
...
throw new Exception("Error X");
} catch (Exception $e) {
$exception = "<b>Caught exception: </b>\n<blockquote>"
.$e->getMessage()
."</blockquote>"
."\n"."on line <b>"
.$e->getLine()
."</b> of <i>"
.$e->getFile()
."</i>";
echo $exception;
}
}
输出是这样的:
Caught exception:
Error X
on line 25 of C:\xampp\htdocs\MgFramework\classes\MgDatabase.class.php
但我想显示访问该方法的行和文件:
$database = new MgDatabase();
$database->configure();
可能吗?
谢谢!