PEAR is archived and read-only

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

Home » Database » DB_DataObject » Bug #4193

sqlite dsn causes invalid _database

Details

Submitted2005-04-20 22:18 UTC
Fromrandy at rcs-comp dot com
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version5.0.2
Roadmaps(Not assigned)

Comments

[2005-04-20 22:18 UTC] randy at rcs-comp dot com

Description:
------------
I was getting errors in the generator because the _database value was the full path of the sqlite database. That meant that line 236 of generator.php was creating a bade $file value.

I changed line 107 to this:

$t->_database = is_file($databasename) ? basename( $databasename) : $databasename;

Not sure about other implications with this change.

There is a similiar problem in dataObject.php in the _connect method when _database gets assigned a value.

Reproduce code:
---------------
Connect to a sqlite database and run the generator

Expected result:
----------------
$file =
c:/htdocs/ocfair2/configuration/classes/db/ocfair.db.ini

Actual result:
--------------
$file =
c:/htdocs/ocfair2/configuration/classes/db/c:/htdocs/ocfair2/configuration/db/ocfair.db.ini