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  


 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-07-12 16:47 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-07-14 10:24 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!