|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00027 class Zend_Exception extends Exception 00028 { 00032 private $_previous = null; 00033 00042 public function __construct($msg = '', $code = 0, Exception $previous = null) 00043 { 00044 if (version_compare(PHP_VERSION, '5.3.0', '<')) { 00045 parent::__construct($msg, (int) $code); 00046 $this->_previous = $previous; 00047 } else { 00048 parent::__construct($msg, (int) $code, $previous); 00049 } 00050 } 00051 00061 public function __call($method, array $args) 00062 { 00063 if ('getprevious' == strtolower($method)) { 00064 return $this->_getPrevious(); 00065 } 00066 return null; 00067 } 00068 00074 public function __toString() 00075 { 00076 if (version_compare(PHP_VERSION, '5.3.0', '<')) { 00077 if (null !== ($e = $this->getPrevious())) { 00078 return $e->__toString() 00079 . "\n\nNext " 00080 . parent::__toString(); 00081 } 00082 } 00083 return parent::__toString(); 00084 } 00085 00091 protected function _getPrevious() 00092 { 00093 return $this->_previous; 00094 } 00095 }