00001 <?php
00002
00007 class oxException extends Exception
00008 {
00014 protected $_sFileName = 'EXCEPTION_LOG.txt';
00015
00022 protected $_blRenderer = false;
00023
00029 protected $_blNotCaught = false;
00030
00037 public function __construct($sMessage = "not set", $iCode = 0)
00038 {
00039 parent::__construct($sMessage, $iCode);
00040 }
00041
00049 public function setLogFileName($sFile)
00050 {
00051 $this->_sFileName = $sFile;
00052 }
00053
00059 public function getLogFileName()
00060 {
00061 return $this->_sFileName;
00062 }
00063
00071 public function setMessage($sMessage)
00072 {
00073 $this->message = $sMessage;
00074 }
00075
00081 public function setRenderer()
00082 {
00083 $this->_blRenderer = true;
00084 }
00085
00091 public function isRenderer()
00092 {
00093 return $this->_blRenderer;
00094 }
00095
00101 public function setNotCaught()
00102 {
00103 $this->_blNotCaught = true;
00104 }
00105
00111 public function isNotCaught()
00112 {
00113 return $this->_blNotCaught;
00114 }
00115
00123 public function debugOut($iDebug = -1)
00124 {
00125 if (0 != $iDebug) {
00126 $f = fopen($this->_sFileName, 'a');
00127 fputs($f, $this->getString() . "\n---------------------------------------------\n");
00128 fclose($f);
00129 }
00130 }
00131
00138 public function getString()
00139 {
00140 $sWarning = "";
00141 if ($this->_blNotCaught)
00142 $sWarning .= "--!--NOT CAUGHT--!--";
00143 if ($this->_blRenderer)
00144 $sWarning .= "--!--RENDERER--!--";
00145 return $sWarning . __CLASS__ . " (time: ". date('Y-m-d H:i:s') ."): [{$this->code}]: {$this->message} \n Stack Trace: {$this->getTraceAsString()}\n\n";
00146 }
00147
00153
00154
00155
00156
00157
00158
00166 public function getValues()
00167 {
00168 return array();
00169 }
00170 }