From: Tim Otten Date: Wed, 7 Jan 2015 02:56:33 +0000 (-0800) Subject: CRM_Core_ClassLoader - Fix compatibility with class_exists() X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a03a3680e28e246a8cc7f247b6c491e17a5460a5;p=civicrm-core.git CRM_Core_ClassLoader - Fix compatibility with class_exists() The previous code would bomb if one called class_exists() on a non-existent CRM class. --- diff --git a/CRM/Core/ClassLoader.php b/CRM/Core/ClassLoader.php index 4ab4e32236..a96787f2fa 100644 --- a/CRM/Core/ClassLoader.php +++ b/CRM/Core/ClassLoader.php @@ -162,9 +162,11 @@ class CRM_Core_ClassLoader { $file = strtr($class, '_', '/') . '.php'; // There is some question about the best way to do this. // "require_once" is nice because it's simple and throws - // intelligible errors. The down side is that autoloaders - // down the chain cannot try to find the file if we fail. - require_once $file; + // intelligible errors. + if (FALSE != stream_resolve_include_path($file)) { + require_once $file; + } } } + }