cvs: pear /Structures_DataGrid DataGrid.php

From: Date: Wed, 12 Apr 2006 13:07:23 +0000
Subject: cvs: pear /Structures_DataGrid DataGrid.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-39569@lists.php.net to get a copy of this message
wiesemann Wed Apr 12 13:07:23 2006 UTC Modified files: /pear/Structures_DataGrid DataGrid.php Log: - apply latest class_exists() change from MDB2 (disables autoload) (related to bug #7304) http://cvs.php.net/viewcvs.cgi/pear/Structures_DataGrid/DataGrid.php?r1=1.53&r2=1.54&diff_format=u Index: pear/Structures_DataGrid/DataGrid.php diff -u pear/Structures_DataGrid/DataGrid.php:1.53 pear/Structures_DataGrid/DataGrid.php:1.54 --- pear/Structures_DataGrid/DataGrid.php:1.53 Sat Apr 1 12:35:58 2006 +++ pear/Structures_DataGrid/DataGrid.php Wed Apr 12 13:07:23 2006 @@ -18,7 +18,7 @@ // | Mark Wiesemann <wiesemann@php.net> | // +----------------------------------------------------------------------+ // -// $Id: DataGrid.php,v 1.53 2006/04/01 12:35:58 wiesemann Exp $ +// $Id: DataGrid.php,v 1.54 2006/04/12 13:07:23 wiesemann Exp $ require_once 'PEAR.php'; @@ -75,7 +75,7 @@ * ?> * </code> * - * @version $Revision: 1.53 $ + * @version $Revision: 1.54 $ * @author Andrew S. Nagy <asnagy@webitecture.org> * @author Olivier Guilyardi <olivier@samalyse.com> * @author Mark Wiesemann <wiesemann@php.net> @@ -225,6 +225,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); + } + + /** * Load a Renderer or DataSource driver * * @param string $className Name of the driver class @@ -233,7 +249,7 @@ */ function &loadDriver($className) { - if (!class_exists($className)) { + if (!Structures_DataGrid::classExists($className)) { $file_name = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; if (!include_once($file_name)) { if (!Structures_DataGrid::fileExists($file_name)) {

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