From 1945463c6db6d4b840c68b7a5fe4899c4efd8a2c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 9 Jan 2015 10:47:38 +0000 Subject: [PATCH] * Mail: fix for Horde_Imap_Client-2.26.0 requiring Horde_Mail-2.5.1 requring Horde_Idna-1.0.1 which stalls our autoloader by calling spl_autoload_register --- phpgwapi/inc/common_functions.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/common_functions.inc.php b/phpgwapi/inc/common_functions.inc.php index 7edc2be12e..7ca7debc9f 100755 --- a/phpgwapi/inc/common_functions.inc.php +++ b/phpgwapi/inc/common_functions.inc.php @@ -1640,6 +1640,9 @@ function __autoload($class) 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 isset($components[0]) && file_exists($file = EGW_INCLUDE_ROOT.'/'.$app.'/inc/class.'.$app.'_'.$components[0].'.inc.php') || + // classes with an underscore in their name + !isset($GLOBALS['egw_info']['apps'][$app]) && isset($GLOBALS['egw_info']['apps'][$app . '_' . $components[0]]) && + file_exists($file = EGW_INCLUDE_ROOT.'/'.$app.'_'.$components[0].'/inc/class.'.$class.'.inc.php') || // eGW api classes using the old naming schema, eg. html file_exists($file = EGW_API_INC.'/class.'.$class.'.inc.php') || // eGW api classes containing multiple classes in on file, eg. egw_exception @@ -1652,7 +1655,7 @@ function __autoload($class) !isset($GLOBALS['egw_info']['apps'][$app]) && @include($file = strtr($class, array('_'=>'/','\\'=>'/')).'.php')) { include_once($file); - //error_log("autoloading class $class by include_once($file)"); + //if (!class_exists($class, false) && !interface_exists($class, false)) error_log("autoloading class $class by include_once($file) failed!"); } // allow apps to define an own autoload method elseif (isset($GLOBALS['egw_info']['flags']['autoload']) && is_callable($GLOBALS['egw_info']['flags']['autoload'])) @@ -1660,6 +1663,8 @@ function __autoload($class) call_user_func($GLOBALS['egw_info']['flags']['autoload'],$class); } } +// register our autoloader with sql, so other PHP code can use spl_autoload_register, without stalling our autoloader +spl_autoload_register('__autoload'); /** * Clasify exception for a headline and log it to error_log, if not running as cli