Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Bug #8296 No Extended (mysql) functions available
Submitted: 2006-07-26 11:23 UTC
From: jonathan dot martens at gmx dot net Assigned: lsmith
Status: Closed Package: MDB2 (version 2.2.0)
PHP Version: 5.0.3 OS: Win XP SP2
Roadmaps: (Not assigned)    
Subscription  


 [2006-07-26 11:23 UTC] jonathan dot martens at gmx dot net (jonathan)
Description: ------------ As I am moving from DB to MDB2 I would like to use the getAssoc functionality for the mysql driver. As this is located in the Extended module I tried to load this module. However this results in a missing file warning. After a inspection of the file tree a Extended directory does not seem to exist in the MDB2\Driver subtree. Installed relevant PEAR modules: - PEAR (1.4.10) - MDB2 (2.2.0) - MDB2_Driver_mysql (1.2.0) Test script: --------------- <?php /* * Use define statements for the DB_* constants * or replace them with the desired value */ $dsn = array( 'phptype' => DB_TYPE, 'hostspec' => DB_HOST, 'database' => DB_DATABASE, 'username' => DB_USERNAME, 'password' => DB_PASSWORD ); $options = array( 'debug' => 2, 'portability' => MDB2_PORTABILITY_ALL ); $mdb =& MDB2::connect($dsn, $options); $mdb->loadModule('Extended'); ?> Expected result: ---------------- Expected result is a flawless load of the Extended module and not a file not found warning on line 914 of MDB2.php: Actual result: -------------- Loading of the Extended module results in a file not found warning for MDB2.php at line 914: Warning in C:\Program Files\php\php-5.0.3\PEAR\MDB2.php on line 914: fopen(MDB2\Driver\Extended\mysql.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: no such file or directory

Comments

 [2006-07-26 11:30 UTC] davidc (David Coallier)
This most likely sounds like a fullpath windows bug (not mentionned the C:\x\y\z\etc) I will test it on windows a little bit later today and give you results. Thanks,
 [2006-07-26 11:36 UTC] lsmith (Lukas Smith)
I presume you have a customer error handler set? Make sure you ignore silenced errors. The implementation in this area is ugly because internals insists on keeping it ugly: http://pear.php.net/bugs/bug.php?id=6226 http://marc.theaimsgroup.com/?l=pear-dev&m=114148949106207&w=2
 [2006-07-26 12:49 UTC] jonathanmartens at gmx dot net (Jonathan)
David, This is not a full path bug I think as the filename is build from the class name on line 1801 of MDB2.php using a strreplace replacing the undesscores for the directory separator: $file_name = str_replace('_', DIRECTORY_SEPARATOR, $class_name).'.php'; I have grepped through the tree and there seems to be no getAssoc function what so ever other then in the MDB2/Extended.php file. Could it be that this feature still has to be implemented in the MDB2_Driver_mysql class? Thanks so far!
 [2006-07-26 12:50 UTC] jonathanmartens at gmx dot net (jonathan)
Lukas, I don't see much use in surpressing a warning that is relevant and shows that the codebase is incomplete or not functioning like it should. If I surpress the warning then the file and hence the medthod is still not loaded. Thanks anyhow!
 [2006-07-26 12:52 UTC] lsmith (Lukas Smith)
No as explained in the bug report I linked. The issue is that loadModule() has to guess if the module is a generic module or is dependent on a specific rdbms. It therefore needs to try two possible file names. Since internals has decided that checking if a file is includeable is not a relevant use case, the only solution are ugly hacks.
 [2006-07-26 13:35 UTC] davidc (David Coallier)
Lukas, as discussed, I will try to setup a environment using safe_mode and I will install the package to then see if is_readable() is better for that bug.
 [2006-07-26 13:40 UTC] lsmith (Lukas Smith)
here are some more urls .. it seems I was using is_readable() already back then: http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2.php?view=diff&r1=1.169&r2=1.170 Some benchmarking .. make sure you read the comments http://paul-m-jones.com/blog/?p=220 Maybe we just need to add checking for this setting: http://de.php.net/manual/en/features.safe-mode.php#ini.safe-mode-include-dir
 [2006-08-19 15:22 UTC] lsmith (Lukas Smith)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. I have updated the code in CVS to use the proper and fast explode on the include path if safe mode is not enabled.
 [2006-09-21 16:46 UTC] tloo at saltstorm dot net (Thomas Loo)
Just noticed that this bug is still present in MDB2 2.2.2 hosted on a Slackware 10.1 / PHP 5.1.6 system with the following php.ini settings: safe_mode = On safe_mode_gid = On safe_mod_include_dir = <PEAR basedir> The safe_mode exception workaround in function MDB2::fileExists, will not work on my system (giving the same error as initially reported in this report (#8296)). Reverting the conditional clause to (!ini_get(..)) making the else statement run instead, I get around this however. This bug is still not resolved, I'd say.
 [2006-09-26 09:50 UTC] lsmith (Lukas Smith)
OK, your proposed change makes sense. Commited. Could you verify CVS for me?
 [2006-10-14 16:29 UTC] lsmith (Lukas Smith)
ok i did some stupid copy&paste typos in my fix .. how about now?
 [2006-11-01 18:49 UTC] lsmith (Lukas Smith)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.