diff --git a/lib/SimpleSAML/Error/Exception.php b/lib/SimpleSAML/Error/Exception.php index de3de2ab931105fac342e5f66e0600b91cc2bd5b..019a27c8b2d4c01b7d626cce9726d83c8bcd280a 100644 --- a/lib/SimpleSAML/Error/Exception.php +++ b/lib/SimpleSAML/Error/Exception.php @@ -31,22 +31,6 @@ class SimpleSAML_Error_Exception extends Exception private $cause; - /** - * Whether debugging is enabled or not. - * - * @var boolean - */ - private $debug; - - - /** - * The base directory for this SimpleSAMLphp installation. - * - * @var string - */ - private $basedir; - - /** * Constructor for this error. * @@ -69,10 +53,6 @@ class SimpleSAML_Error_Exception extends Exception if ($cause !== null) { $this->cause = SimpleSAML_Error_Exception::fromException($cause); } - - $config = SimpleSAML_Configuration::getInstance(); - $this->debug = $config->getBoolean('debug', false); - $this->basedir = $config->getBaseDir(); } @@ -189,6 +169,7 @@ class SimpleSAML_Error_Exception extends Exception public function formatBacktrace($anonymize = false) { $ret = array(); + $basedir = SimpleSAML_Configuration::getInstance()->getBaseDir(); $e = $this; do { @@ -200,7 +181,7 @@ class SimpleSAML_Error_Exception extends Exception $depth = count($e->backtrace); foreach ($e->backtrace as $i => $trace) { if ($anonymize) { - $trace = str_replace($this->basedir, '', $trace); + $trace = str_replace($basedir, '', $trace); } $ret[] = ($depth - $i - 1).' '.$trace; @@ -217,7 +198,7 @@ class SimpleSAML_Error_Exception extends Exception */ protected function logBacktrace() { - if (!$this->debug) { + if (!SimpleSAML_Configuration::getInstance()->getBoolean('debug', false)) { return; }