cvs: pear /MDB2 MDB2.php

From: Date: Sun, 09 Apr 2006 16:11:44 +0000
Subject: cvs: pear /MDB2 MDB2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-39517@lists.php.net to get a copy of this message
lsmith Sun Apr 9 16:11:44 2006 UTC Modified files: /pear/MDB2 MDB2.php Log: - disable __autoload() in several class_exists() calls (similar reason as in bug #7304) http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2.php?r1=1.181&r2=1.182&diff_format=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.181 pear/MDB2/MDB2.php:1.182 --- pear/MDB2/MDB2.php:1.181 Fri Apr 7 15:24:46 2006 +++ pear/MDB2/MDB2.php Sun Apr 9 16:11:44 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.181 2006/04/07 15:24:46 lsmith Exp $ +// $Id: MDB2.php,v 1.182 2006/04/09 16:11:44 lsmith Exp $ // /** @@ -290,6 +290,22 @@ } /** + * Checks if a class exists without triggering __autoload + * + * @param string classname + * @return bool true success and false on error + * + * @access public + */ + function classExists($classname) + { + if (version_compare(phpversion(), "5.0", ">=") { + return class_exists($classname, false); + } + return class_exists($classname); + } + + /** * Loads a PEAR class. * * @param string $class_name classname to load @@ -300,7 +316,7 @@ */ function loadClass($class_name, $debug) { - if (!class_exists($class_name)) { + if (!MDB2::classExists($class_name)) { $file_name = str_replace('_', DIRECTORY_SEPARATOR, $class_name).'.php'; if ($debug) { $include = include_once($file_name); @@ -1596,7 +1612,7 @@ $file_name = str_replace('_', DIRECTORY_SEPARATOR, $class_name).'.php'; } if ($phptype_specific === false - || (!class_exists($class_name) && !MDB2::fileExists($file_name)) + || (!MDB2::classExists($class_name) && !MDB2::fileExists($file_name)) ) { $version = false; $class_name = 'MDB2_'.$module;

« previous php.pear.cvs (#39517) next »