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

Request #19344 Class presence not tested before inclusion
Submitted: 2012-03-22 22:48 UTC
From: kanea Assigned: avb
Status: Closed Package: HTTP_Request2 (version 2.0.0)
PHP Version: 5.3.5 OS: all
Roadmaps: 2.1.0    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 2 + 46 = ?

 
 [2012-03-22 22:48 UTC] kanea (nicolas dm)
Description: ------------ For a plugin which connect wordpress to CaasuleCRM that i realized for a client, i must integrate a default solution if PEAR is not present. To make that, i remove the require_once and concanete all class in a single file. Every works fine (capasule and other depandency) except this line 821 wich don't test the class existance before make the include. So i propose a solution in expected result Test script: --------------- Line 821 in Request2.php : if (!class_exists($adapter, false)) and preg_match('/^HTTP_Request2_Adapter_([a-zA-Z0-9]+)$/', $adapter)) { include_once str_replace('_', DIRECTORY_SEPARATOR, $adapter) . '.php'; } Expected result: ---------------- <?php if (!class_exists($adapter, false)) { if (preg_match('/^HTTP_Request2_Adapter_([a-zA-Z0- 9]+)$/', $adapter)) { include_once str_replace('_', DIRECTORY_SEPARATOR, $adapter) . '.php'; } }

Comments

 [2012-03-22 22:58 UTC] avb (Alexey Borzov)
-Status: Open +Status: Feedback
Please provide your proposed changes as a diff against current SVN. Use "Add patch" link to upload. It is extremely hard to read currently.
 [2012-03-23 01:05 UTC] kanea (nicolas dm)
 [2012-03-23 01:06 UTC] kanea (nicolas dm)
Hoping this is clearer with this.
 [2012-03-23 01:09 UTC] kanea (nicolas dm)
After reread, this is really hard to distinguish code with my identation and no colors. A simple question, is it possible to have highlighting with this comments boxes?
 [2012-03-28 00:06 UTC] avb (Alexey Borzov)
-Status: Feedback +Status: Assigned -Assigned To: +Assigned To: avb -Roadmap Versions: +Roadmap Versions: 2.1.0
I don't think highlighting works here. Thanks, I now see the problem, I'll add your changes.
 [2012-04-04 21:51 UTC] avb (Alexey Borzov)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. 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.