From 2aa82e48ff9f9af60d999e45905a68491dd6108a Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 11 Jan 2008 12:33:17 +0000 Subject: [PATCH] expanding the autoload function to enable it to step through the registered modules to find old naming shema classes. This is due to a bug in felamimail, when typing an address, the auto completion produces an XML Error, because the socontacts_sql class is not found. The problem may be resolved by another method, the solution provided here is probably not wanted, for proper style reasons, and will not solve all possible autoload problems. --- phpgwapi/inc/common_functions.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/common_functions.inc.php b/phpgwapi/inc/common_functions.inc.php index 52cf9af143..c5c8a962c9 100755 --- a/phpgwapi/inc/common_functions.inc.php +++ b/phpgwapi/inc/common_functions.inc.php @@ -1306,8 +1306,9 @@ */ function __autoload($class) { - list($app,$baseclass) = explode('_',$class); - + $components = explode('_',$class); + $app =array_shift($components); + $baseclass = implode('_', $components); // classes using the new naming schema app_class_name, eg. admin_cmd if (file_exists($file = EGW_INCLUDE_ROOT.'/'.$app.'/inc/class.'.$class.'.inc.php') || // classes using the new naming schema app_class_name, eg. admin_cmd @@ -1323,6 +1324,13 @@ function __autoload($class) { //error_log("autoloaded class $class from $file"); include_once($file); + } else { + foreach($GLOBALS['egw_info']['apps'] as $lapp=>$appvalue){ + if (file_exists($file = EGW_INCLUDE_ROOT.'/'.$lapp.'/inc/class.'.$class.'.inc.php')){ + #echo "$lapp,$class
"; + include_once($file); + } + } } }