PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #2218

failed include because of empty dsn

Details

Request #2218failed include because of empty dsn
Submitted2004-08-25 22:05 UTC
Frommaralo at softwarekueche dot de
Assigneddanielc
StatusBogus
PackageDB
PHP Version5.0.0
OSFedora Core 2
Roadmaps(Not assigned)

Comments

[2004-08-25 22:05 UTC] maralo at softwarekueche dot de

Description:
------------
when you ask to connect to the a db, the DB.php tries to include the file DB/<dbtype>.php. also when you have an empty dsn! this causes of cause two not very nice warnings.

it would be a very nice feature if the DB.php would check first the dsn and include than the files (or not) :-)

Reproduce code:
---------------
<?php
ini_set('error_reporting', E_ALL);
require_once('DB.php');
$db = DB::connect('');
if( DB::isError($db) ) {
die($db->getMessage());
}
?>

Expected result:
----------------
no notice/warning/error :-)

Actual result:
--------------
Warning: DB::connect(DB/.php) [function.connect]: failed to open stream: Datei oder Verzeichnis nicht gefunden in /home/docroot/blog/libs/pear/DB.php on line 371

Warning: DB::connect() [function.include]: Failed opening 'DB/.php' for inclusion (include_path='.:/usr/share/pear') in /home/docroot/blog/libs/pear/DB.php on line 371