From: Michael J. Rubinsky Date: Tue, 4 Aug 2009 19:53:52 +0000 (-0400) Subject: Will discuss this with Chuck, but until then, make this an incldue_once X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c671447a332e15ed30d748311748b4ec556ccd03;p=horde.git 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. --- 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;