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

Bug #16347 Cache code suffers from tremendous bugs
Submitted: 2009-06-19 04:11 UTC
From: dmitrystolyarov Assigned: beni
Status: Closed Package: Net_LDAP2 (version 2.0.1)
PHP Version: 5.2.9 OS: Gentoo Linux
Roadmaps: 2.1.0    
Subscription  


 [2009-06-19 04:11 UTC] dmitrystolyarov (Dmitry Stolyarov)
Description: ------------ There are two critical bugs that make cache out of service. Patch attached.

Comments

 [2009-06-19 05:28 UTC] doconnor (Daniel O'Connor)
Want to add test steps/test cases
 [2009-06-19 15:37 UTC] dmitrystolyarov (Dmitry Stolyarov)
When happens: using schema cache. Reproducible: always. First of all, in the following line, an undefined variable (not schema) is assigned to the cache. It causes PHP notice. $caching_result = $this->_schema_cache->storeSchema($schema); The clause in the registerSchemaCache function will _always_ return an error. You can read it just as following: "the variable is neither null nor object". The first clause ("is not null") is always true for object but the second one ("is not object") is always true for null variable. Other clauses aren't even in use. public function registerSchemaCache($cache) { if (!is_null($cache) || !is_object($cache) || !in_array('Net_LDAP2_SchemaCache', class_implements($cache))) { // always true return new Net_LDAP2_Error('Custom schema caching object ...'); } ... } So, cache in the 2.0.1 release just doesn't work. It's impossible to register an object for caching, and even if you can — nothing will be ever saved. P.S. The patch attached fixes both errors — and everything works fine with it. The only thing is that you can't execute registerSchemaCache with "null" (maybe, it will be useful to add the unregisterSchemaCache function that will accept the "null" instead of cache object).
 [2009-06-29 20:46 UTC] beni (Benedikt Hallinger)
-Status: Open +Status: Closed -Assigned To: +Assigned To: beni
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.
 [2009-06-29 20:46 UTC] beni (Benedikt Hallinger)
-Roadmap Versions: +Roadmap Versions: 2.1.0