mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-20 15:08:00 +00:00
added logging for rendered images closes #25
This will enable us to check if an image hasn't been requested for a long time so we can do some houskeeping
This commit is contained in:
@@ -150,14 +150,16 @@ function renderImage($data)
|
|||||||
unset($data['changecode']);
|
unset($data['changecode']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$pm = new PictshareModel();
|
$pm = new PictshareModel();
|
||||||
$base_path = ROOT.DS.'upload'.DS.$hash.DS;
|
$base_path = ROOT.DS.'upload'.DS.$hash.DS;
|
||||||
$path = $base_path.$hash;
|
$path = $base_path.$hash;
|
||||||
$type = $pm->isTypeAllowed($pm->getTypeOfFile($path));
|
$type = $pm->isTypeAllowed($pm->getTypeOfFile($path));
|
||||||
$cached = false;
|
$cached = false;
|
||||||
|
|
||||||
|
//update last_rendered of this hash so we can later
|
||||||
|
//sort out old, unused images easier
|
||||||
|
@file_put_contents($base_path.'last_rendered.txt',time());
|
||||||
|
|
||||||
$cachename = $pm->getCacheName($data);
|
$cachename = $pm->getCacheName($data);
|
||||||
$cachepath = $base_path.$cachename;
|
$cachepath = $base_path.$cachename;
|
||||||
if(file_exists($cachepath))
|
if(file_exists($cachepath))
|
||||||
|
|||||||
Reference in New Issue
Block a user