Index: DefaultHandler.php
===================================================================
--- DefaultHandler.php	(revision 49242)
+++ DefaultHandler.php	(working copy)
@@ -53,6 +53,8 @@
 
 	public static $error_page_source = null;
 	
+	protected static $extra_environment_information = array();
+	
 	/*
 	 termination errors as specified by "fatal errors" see:
 	 http://uk3.php.net/manual/en/errorfunc.constants.php
@@ -480,7 +482,23 @@
 				}
 			}
 		}
-		
+		if (count(self::$extra_environment_information)>0) {
+			$error .= "Additional Information:\n";
+				foreach (self::$extra_environment_information as $variable => $value) {
+					// TODO: Iterate this properly for arrays with >2 dimensions...
+					if (is_array($value)) {
+						foreach($value as $array_key => $array_value) {
+							if (is_scalar($array_value)) {
+								$error .= $variable . "[$array_key]: $array_value\n";
+							} else {
+								$error .= $variable . "[$array_key]: ". gettype($array_value) . "\n";
+							}
+						}
+					} else {
+						$error.= "$variable: $value\n";
+					}
+				}
+		}
 		return $error;
 	}
 	
@@ -692,5 +710,16 @@
 		
 		return false;
 	}
-
+	
+	/**
+	 * Function to add extra information to enviorment information, so that it is returned if there is an issue
+	 *
+	 *	@param array $info - Additional information 
+	 */
+	public static function addEnvironmentInformation(array $info)
+	{
+			self::$extra_environment_information = array_merge(self::$extra_environment_information, $info);
+	}
+	
+	
 }
