Browse Source

Fix fatal error when E_STRICT is enabled.

If you have E_STRICT enabled and have a strict error in your files, you
would see a fatal error related to Debugger missing.  PHP won't autoload
classes if you are currently in an autoload call, and an error is
triggered.  Preloading Debugger + String in dev mode lets you see the
correct error.
mark_story 13 years ago
parent
commit
35e0984bec
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lib/Cake/Core/Configure.php

+ 6 - 1
lib/Cake/Core/Configure.php

@@ -98,7 +98,12 @@ class Configure {
 				self::$_values['Error'],
 				self::$_values['Exception']
 			);
-			unset($error, $exception);
+
+			// Preload Debugger + String in case of E_STRICT errors when loading files.
+			if (self::$_values['debug'] > 0) {
+				class_exists('Debugger');
+				class_exists('String');
+			}
 		}
 	}