From c671447a332e15ed30d748311748b4ec556ccd03 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Tue, 4 Aug 2009 15:53:52 -0400 Subject: [PATCH] Will discuss this with Chuck, but until then, make this an incldue_once to avoid fatal Cannot redeclare Class errors when using any external libraries. --- framework/Autoloader/lib/Horde/Autoloader.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/Autoloader/lib/Horde/Autoloader.php b/framework/Autoloader/lib/Horde/Autoloader.php index 595387bf9..a4f2e347c 100644 --- a/framework/Autoloader/lib/Horde/Autoloader.php +++ b/framework/Autoloader/lib/Horde/Autoloader.php @@ -57,7 +57,13 @@ class Horde_Autoloader $err_mask = $err_mask ^ E_DEPRECATED; } $oldErrorReporting = error_reporting($err_mask); - $included = include $file_path . '.php'; + //@TODO: This may be a neccessary evil since any external + // library that triggers an Autoloader for a class that is named + // the same as any file that is currently in the include_path + // (which includes all lib/* files for applications currently on + // the stack) will cause that file to possibly load that file + // more then once. This causes fatal Cannon redeclare class errors. + $included = include_once $file_path . '.php'; error_reporting($oldErrorReporting); if ($included) { return true; -- 2.11.0