From 64b26c354fdb2c8941c705a37f86e051754183e6 Mon Sep 17 00:00:00 2001 From: Anton Terekhov Date: Thu, 20 Oct 2011 12:15:10 +0400 Subject: [PATCH] Removed unused MJException --- classes/MJException.class.php | 66 ------------------------------------------- redis/RedisDebug.php | 2 +- 2 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 classes/MJException.class.php diff --git a/classes/MJException.class.php b/classes/MJException.class.php deleted file mode 100644 index 6fb9ed4..0000000 --- a/classes/MJException.class.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @link - * @package Majestic - * @subpackage Core - * @since - * @version SVN: $Id$ - * @filesource $URL$ - */ -class MJException extends Exception -{ - private $line_range = 6; - - public function terminate() - { - if (!DEBUG_ENABLE) { - trigger_error($this->getMessage()); - throw new StaticPageException(500); - } - - $return = "MJ Error: "; - $return .= str_replace("\n", "
\n", $this->getMessage())."
\n"; - - $trace = $this->getTrace(); - - $file = reset($trace); - - //смещение в трейсе, указаное при вызове эксепшена (2й параметр). Нужно для более инофрмативного вывода - if ($shift = abs($this->getCode())) { - while($shift--) { - $file = next($trace); - } - } - - if ($fp = fopen($file['file'], 'r')) { - $error_line = $file['line']; - $start = $error_line - $this->line_range; - $end = $error_line + $this->line_range; - $i = 1; - $return .= "
";
-            while ($line = fgets($fp, 4096) and $i<=$end) {
-                $line = htmlspecialchars($line);
-                if ($i >= $start && $i <= $end) {
-                    if ($i == $error_line) $return .= '
'.$i.' '.$line.'
'; - else $return .= $i.' '.$line; - } - $i++; - } - $return .= "
"; - fclose($fp); - } - - $return .= ''; - $return .= "\n'; - foreach($trace as $row) { - if (isset($row['file'])) { //throwing exception from __call method will not return file and line - $return .= "\n'; - } - } - return $return . '
Backtrace
".$this->getFile().''.$this->getLine().'
".$row['file'].''.$row['line'].'
'; - } -} -?> \ No newline at end of file diff --git a/redis/RedisDebug.php b/redis/RedisDebug.php index 050b1d1..692f0ea 100644 --- a/redis/RedisDebug.php +++ b/redis/RedisDebug.php @@ -16,7 +16,7 @@ class RedisDebug public function __construct($redis) { if (!is_a($redis, 'Redis')) { - throw new MJException(); + throw new GeneralException(); } $this->redis = $redis; }