oxexception.php

Go to the documentation of this file.
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         }
00144 
00145         if ( $this->_blRenderer ) {
00146             $sWarning .= "--!--RENDERER--!--";
00147         }
00148 
00149         return $sWarning . __CLASS__ . " (time: ". date('Y-m-d H:i:s') ."): [{$this->code}]: {$this->message} \n Stack Trace: {$this->getTraceAsString()}\n\n";
00150     }
00151 
00157     /*
00158     public function __toString()
00159     {
00160         return $this->getString();
00161     }
00162     */
00170     public function getValues()
00171     {
00172         return array();
00173     }
00174 }

Generated on Wed Apr 22 12:26:30 2009 for OXID eShop CE by  doxygen 1.5.5