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

Bug #1758 warning generated
Submitted: 2004-07-01 00:29 UTC
From: djpenton at cs dot mu dot oz dot au Assigned: fab
Status: Closed Package: Cache_Lite
PHP Version: 4.3.4 OS: Solaris
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


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 : 24 - 24 = ?

 
 [2004-07-01 00:29 UTC] djpenton at cs dot mu dot oz dot au
Description: ------------ Hi, Thanks for the package. It's very easy to use and just what I wanted. It throws a warning when attempting to read a file that doesn't exist. It is marked with an @ to tell php you don't care (so in a sense it's a php anomoly). Change Line 271 Lite.php if (@filemtime($this->_file) > $this->_refreshTime) { To: if (file_exists($this->_file) && @filemtime($this->_file) > $this->_refreshTime) { Unfortunately, I have to have warnings creating big ugly error messages. Cheers, Dave. Reproduce code: --------------- $GlobalCache->save("null",$xml_file_name,"null"); if ($data=$GlobalCache->get($xml_file_name, "tree")) { //Goodo $tree=unserialise($data); } else { $tree = new XML_Tree($xml_file_name); $tree->getTreeFromFile(); $tree->get(); $GlobalCache->save(serialise($tree),$xml_file_name, "tree"); } Expected result: ---------------- $tree with no warning Actual result: -------------- $tree with warning

Comments

 [2004-07-11 20:43 UTC] gurugeek
Dear Maintainer, Your package cache_lite has currently 1 open bug. We urge you to take the necessary steps to solve the reported issues at your soonest convenience. If the bug issue hasn’t been addressed yet you are kindly asked to take the necessary steps to ensure a prompt resolution of the problem. If you already addressed the reported problem feel free to change the bug status as soon as possible. Regards David Costa PEAR Quality Assurance pear-qa@lists.php.net
 [2004-07-12 16:47 UTC] fab
sorry for the delay but I was away from my computer. I will test your patch soon. But, what about perfs ? Still the same ?
 [2004-07-12 23:54 UTC] djpenton at cs dot mu dot oz dot au
I suspect performance will be close to identical. The worst case will cause it to take an extra 1/500 of a second. There is a note on the php page: flobee at gmx dot net 23-Jun-2004 03:05 yust a little note: some people told me that they dont use this function because of taking too much performance/time: well, they are right in some ways: if you expect a file this function runs perferct. if it don´t find a file it takes really long: benchmark in a for() statment 500 circles using file_exists() to be TRUE : 0.00378203392029 using file_exists() to be FALSE: 0.951257944107
 [2004-07-14 10:20 UTC] fab
Ok, I will add your patch to the CVS version. Thanks :-)
 [2004-07-14 10:24 UTC] fab
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.