diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-08-17 15:30:01 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-08-17 15:30:01 +0000 |
commit | 077617424ce4917fa6bdbb01873c0c2207342a03 (patch) | |
tree | d609b951245f8bb4e657ccc504bfeb105b9b190b /includes/database/database.inc | |
parent | 401d1bb8ff7d2a08ad4a8b5e7ea802a9cf20517c (diff) | |
download | brdo-077617424ce4917fa6bdbb01873c0c2207342a03.tar.gz brdo-077617424ce4917fa6bdbb01873c0c2207342a03.tar.bz2 |
- Patch #857206 by Stevel: fixed database autoloader.
Diffstat (limited to 'includes/database/database.inc')
-rw-r--r-- | includes/database/database.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc index 1ca68eea8..73cb243e5 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -2138,8 +2138,16 @@ function db_autoload($class) { foreach ($driver_files as $file => $classes) { if (in_array($base, $classes)) { - require_once "{$base_path}/{$driver}/{$file}"; - return; + $filename = "{$base_path}/{$driver}/{$file}"; + // We might end up looking in a file that doesn't exist, so check that. + if (file_exists($filename)) { + require_once $filename; + // If the class now exists, we're done. Otherwise keep searching in + // additional files. + if (class_exists($class, FALSE) || interface_exists($class, FALSE)) { + return; + } + } } } } |