PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject » Bug #7409

DB_DataObject ibase

Details

Submitted2006-04-17 14:18 UTC
Fromsilviucristea at yahoo dot com
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP VersionIrrelevant
OSWinXP
Roadmaps(Not assigned)

Comments

[2006-04-17 14:18 UTC] silviucristea at yahoo dot com

Description:
------------
database =
"ibase(firebird)://user:pass@host/D%3A%2Ftest.fdb?dialect=3"
schema_location = "/dataobject"
class_location = "/dataobject"
require_prefix = "dataobject/"
class_prefix = "DataObject_"

so "/dataobject/D:/Ftest.fdb.ini" is invalid

Test script:
---------------
if (($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['phptype'] == 'sqlite')
&& is_file($this->_database))
{
$this->_database = basename($this->_database);
}
+ else if (($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['phptype'] == 'ibase'))
+ {
+ $this->_database = substr(basename($this->_database), 0, -4);
+ }

[2006-04-17 14:21 UTC] silviucristea at yahoo dot com

so "/dataobject/D:/test.fdb.ini" is invalid

[2006-04-25 07:31 UTC] silviucristea at yahoo dot com

log:
----
DataObject_Users: CONNECT: Checking for database database_ in options
DataObject_Users: CONNECT: NEW CONNECTION
DataObject_Users: CONNECT: ibase(firebird)://user:pass@host/D%3A%2Ftest.fdb?dialect=3 0dbd22011b75f3a601fd32a7c07c06be
DataObject_Users: CONNECT: [...]
DataObject_Users: find:
DataObject_Users: databaseStructure: Missing ini file: /dataobject/D:/test.fdb.ini
DataObject_Users: databaseStructure: Cant find database schema: D:/test.fdb/USERS
in links file data: Array
(
)

DataObject_Users: ERROR: Unable to load schema for database and table (turn debugging up to 5 for full error message)
DB_DataObject Error: Unable to load schema for database and table (turn debugging up to 5 for full error message)
-------------------

solution:
---------
The next code apears 3 times in the "_connect" function

> if (($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['phptype'] == 'sqlite')
> && is_file($this->_database))
> {
> $this->_database = basename($this->_database);
> }

... it was changed in only one place.
-------------------

[2006-04-25 14:53 UTC] silviucristea at yahoo dot com

the same thing in class DB_DataObject_Generator

if (($dsn['phptype'] == 'sqlite') && is_file($databasename)) {
$t->_database = basename($t->_database);
}
+ if ($dsn['phptype'] == 'ibase') {
+ $t->_database = substr(basename($t->_database), 0, -4);
+ }

[2006-04-26 07:06 UTC] silviucristea at yahoo dot com

Another problem in class DB_DataObject_Generator...

var_dump($this->tables)
array(44) {
[0] => string(31) "TABLE01 "
[1] => string(31) "T02 "
}

//after $this->tables initialization
+ foreach ($this->tables as $dvl_idx => $dvl_table) {
+ $this->tables[$dvl_idx] = trim($dvl_table);
+ }

var_dump($this->tables)
array(44) {
[0] => string(18) "TABLE01"
[1] => string(19) "T02"
}