Closed (fixed)
Project:
Brilliant Gallery
Version:
5.x-2.14
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Nov 2007 at 06:55 UTC
Updated:
23 Dec 2007 at 14:21 UTC
Hello,
I turned on the cache in Brilliant Gallery, and I found this error in Druplas log:
filectime() [function.filectime]: stat failed for /home/www/vhosts/domain.tld/public_html/tmp/bg_c82ea93c370302f9f85e86e808c01025 in /home/www/vhosts/domain.tld/public_html/sites/all/modules/brilliant_gallery/image.php on line 60.
I use Gentoo linux, PHP 5.2.5, lighttpd 1.4.18
Do you need more info?
Comments
Comment #1
Nitagob commentedI have changed the following function in /sites/all/modules/brilliant_gallery/image.php:
function resizeimage_wrapper_filecache() {
...
some code/comments here
...
#$cachedfile = file_directory_temp() . '/' . $bgcacheid;
$cachedfile = realpath(file_directory_temp() . '/' . $bgcacheid);
...
...
$lastchanged = filemtime( $cachedfile ); # was filectime() originally
...
}
Btw, I have Drupal 5.3 on Windows XP Pro, so the filepath to cache files has mix-slashes, for example:
/files/tmp\bg_ahfphq1f437rg1uiytqo68wetqrwe7r
Comment #2
Nitagob commentedupd: It was a mistake, to realpath(...) it.
But still, filemtime is better for me than filectime, see _notes at:
http://ru2.php.net/manual/en/function.filectime.php
And there should be added some check for file existence, I guess - to remove PHP error messages.
upd:
It looks so for now:
$lastchanged = (file_exists($cachedfile) ? filemtime( $cachedfile ) : false);
Comment #3
laszlo.laszlo commentedNitagob,
I modified the image.php file, and after that no more PHP error messages. Thank you!
Comment #4
Nitagob commentedDon't give up, laszlo.laszlo - you can get some more PHP errors! ;))
At least, there are few after direct modification of cache or image files: when user requests image (via 'old' page) that was renamed/removed, and the cache purged - the user get black picture instead of error message and recommendation to update page, and there are PHP errors in log: "file not found", etc.
Still, there no any useful_programs without errors! :)
Comment #5
vacilando commentedGood idea about checking for file existence there; applied now. Thanks to Nitagob.
Cheers,
Tomáš
Comment #6
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.