cvs: pear /MDB MDB.php

From: Date: Fri, 31 May 2002 11:03:03 +0000
Subject: cvs: pear /MDB MDB.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4315@lists.php.net to get a copy of this message
lsmith Fri May 31 07:03:03 2002 EDT Modified files: /pear/MDB MDB.php Log: changed handling of the include path Index: pear/MDB/MDB.php diff -u pear/MDB/MDB.php:1.10 pear/MDB/MDB.php:1.11 --- pear/MDB/MDB.php:1.10 Tue May 21 16:16:22 2002 +++ pear/MDB/MDB.php Fri May 31 07:03:03 2002 @@ -16,7 +16,7 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: MDB.php,v 1.10 2002/05/21 20:16:22 lsmith Exp $ +// $Id: MDB.php,v 1.11 2002/05/31 11:03:03 lsmith Exp $ // // Database independent query interface. // @@ -302,13 +302,18 @@ null, null, 'no existing DBMS driver specified', 'MDB_Error', true); } } + $include_path = (isset($options["includepath"]) ? $options["includepath"] : dirname(__FILE__)); if (!strcmp($included,"") || !defined($included)) { - $include_path = (isset($options["includepath"]) ? $options["includepath"] : dirname(__FILE__)); - if ($include_path != "" && $include_path[strlen($include_path)-1] != "/") { - $include="/".$include; + $length = strlen($include_path); + $separator = ""; + if($length) { + $directory_separator = (defined("DIRECTORY_SEPARATOR") ? DIRECTORY_SEPARATOR : "/"); + if ($include_path[$length-1]!=$directory_separator) + $separator = $directory_separator; } - if (!file_exists($include_path.$include)) { + + if(!file_exists($include_path.$separator.$include)) { $directory = 0; if (!strcmp($include_path,"") || ($directory = @opendir($include_path))) @@ -323,13 +328,14 @@ null, null, 'no valid DBMS driver include path specified', 'MDB_Error', true); } } - include($include_path.$include); + include($include_path.$separator.$include); } if (!class_exists($class_name)) { return PEAR::raiseError(null, DB_ERROR_NOT_FOUND, null, null, null, 'MDB_Error', true); } $db = new $class_name; + $db->include_path=$include_path; if (isset($dsninfo["phptype"])) { $db->phptype = $dsninfo["phptype"]; }

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