Home » Database » MDB2 » Bug #7404
Unable to find modules with several version of pear
Details
| Request #7404 | Unable to find modules with several version of pear |
|---|---|
| Submitted | 2006-04-15 19:38 UTC |
| From | christian_rocher at hotmail dot com |
| Status | Wont fix |
| Package | MDB2 |
| PHP Version | 4.3.10 |
| OS | Windows |
| Roadmaps | (Not assigned) |
Comments
[2006-04-15 19:38 UTC] christian_rocher at hotmail dot com
Description:
------------
Hi,
I need to maintain an existing web site (MySQL) with an older version of pear and I must create a new web site (PostgreSQL) with the lastest version of Pear packages. But I can't upgrade my pear packages registered in php.ini because I don't want test all the existing stuff again or risk to break something.
I copied all pear packages I need in the include path of my new site. But the MDB2 package use its internal function "fileExists" to check if a modules exists. This function uses only the paths from the "include_path" environment variable of my php.ini. Therefore the MDB2 can't find new modules for PostgreSQl and I don't want to mix versions in the "official" path of pear on my server.
Actually, I have a workarround : I add my path :
ini_set('include_path','mypath;'/.ini_get('include_path'));
before calling MDB2 and I remove it after. But it's not robust, if if forget to do it, I can have the feeling that all works fine but in fact I can encounter errors later depending of differences between versions of pear packages.
I would be useful to be able to specify a path to MDB2 (and other packages is applicable). Because this is safer to develop new code without the risk to break code in production and install several version of pear on the same server when needed.
Thank you.
Test script:
---------------
$dsn = array
( 'phptype' => 'mysql',
'username' => 'me',
'password' => 'mypwd',
'hostspec' => 'localhost',
'database' => 'mydb');
$db =& MDB2::factory($dsn);
if (PEAR::isError($db)) {
echo ($mdb2->getMessage());
}
$reverse =& $db->loadModule('Reverse', null, true);
if (PEAR::isError($db)) {
echo ($mdb2->getMessage());
}
$table_info = $reverse->tableInfo('pictures');
if (PEAR::isError($db)) {
echo ($mdb2->getMessage());
}
else {
var_dump( $table_info);
}
Expected result:
----------------
The dump of the table's definition
Actual result:
--------------
Fatal error: Call to undefined function: tableinfo() in c:\www\dev\testmdb2.php on line 55
[2006-04-17 01:49 UTC] christian_rocher at hotmail dot com
Hi,
I understand that there are other priorities for MDB2. But I cannot be agree when you say:"However I think that you are probably concerned about a non issue or there is no chance anyways.".
When I speak about versions of MDB2 I include the associated version of PEAR. It's clear that I can't work with PEAR version 1.0 and MDB2 2.01. And it's truth for future versions. This is why I must be able to maintain several versions of PEAR and its compatible packages. I can't wait a call from customer in the futur to manage this situation. I must be safe from now and if I don't want to come back on existing code in the future, the code that I develop now must be safe even when MDB3 will be available.
You don't offer - in the future - the opportunity for developers to work on the latest version of PEAR (I mean : pear.php and MDB2.5.php or MDB3.php) and on another in production (pear.php and MDB2). It is a common case for people in the real life. I don't know professional developers who update packages in production just to be able to use it in new development. Each version of software must be able to cohabit with others or we are forced to keep old versions of PEAR to be safe.
It's my point of view and I think that it must be fixed for the next version of MDB2 that will need another version of PEAR.php.