forked from extern/egroupware
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.
This commit is contained in:
parent
835bf3050d
commit
2aa82e48ff
@ -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<br>";
|
||||
include_once($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user