Move exception to its own directory
Move exception to its own directory

--- a/include/AutoLoader.class.php
+++ b/include/AutoLoader.class.php
@@ -71,12 +71,13 @@
 			$path = 'git/log/';
 		} else if (strncmp($classname, 'Archive', 7) === 0) {
 			$path = 'git/archive/';
+		} else if ((strlen($classname) > 9) && (substr_compare($classname, 'Exception', -9, 9) === 0)) {
+			$path = 'exception/';
 		} else if (strpos($classname, 'Cache') !== false) {
 			$path = 'cache/';
 		} else if (in_array($classname, array(
 				'Config',
 				'DebugLog',
-				'MessageException',
 				'Resource',
 				'Util'
 			))) {

--- a/include/MessageException.class.php
+++ /dev/null
@@ -1,40 +1,1 @@
-<?php
-/**
- * Custom exception for signalling display of a message to user
- *
- * @author Christopher Han <xiphux@gmail.com>
- * @copyright Copyright (c) 2010 Christopher Han
- * @package GitPHP
- */
-class GitPHP_MessageException extends Exception
-{
 
-	/**
-	 * Whether this is an error or informational
-	 *
-	 * @var boolean
-	 */
-	public $Error;
-
-	/**
-	 * HTTP status code
-	 *
-	 * @var integer
-	 */
-	public $StatusCode;
-	
-	/**
-	 * Constructor
-	 *
-	 * @param string $message message string
-	 * @param boolean $error true if this is an error rather than informational
-	 * @param integer $statusCode HTTP status code to return
-	 * @param integer $code exception code
-	 */
-	public function __construct($message, $error = false, $statusCode = 200, $code = 0) {
-		$this->Error = $error;
-		$this->StatusCode = $statusCode;
-		parent::__construct($message, $code);
-	}
-}
-

--- /dev/null
+++ b/include/exception/MessageException.class.php
@@ -1,1 +1,40 @@
+<?php
+/**
+ * Custom exception for signalling display of a message to user
+ *
+ * @author Christopher Han <xiphux@gmail.com>
+ * @copyright Copyright (c) 2010 Christopher Han
+ * @package GitPHP
+ */
+class GitPHP_MessageException extends Exception
+{
 
+	/**
+	 * Whether this is an error or informational
+	 *
+	 * @var boolean
+	 */
+	public $Error;
+
+	/**
+	 * HTTP status code
+	 *
+	 * @var integer
+	 */
+	public $StatusCode;
+	
+	/**
+	 * Constructor
+	 *
+	 * @param string $message message string
+	 * @param boolean $error true if this is an error rather than informational
+	 * @param integer $statusCode HTTP status code to return
+	 * @param integer $code exception code
+	 */
+	public function __construct($message, $error = false, $statusCode = 200, $code = 0) {
+		$this->Error = $error;
+		$this->StatusCode = $statusCode;
+		parent::__construct($message, $code);
+	}
+}
+

comments