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:
Christian Haschek
2017-03-02 23:22:23 +01:00
parent 93f1ea3426
commit 5dadef959b

View File

@@ -150,14 +150,16 @@ function renderImage($data)
unset($data['changecode']);
}
$pm = new PictshareModel();
$base_path = ROOT.DS.'upload'.DS.$hash.DS;
$path = $base_path.$hash;
$type = $pm->isTypeAllowed($pm->getTypeOfFile($path));
$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);
$cachepath = $base_path.$cachename;
if(file_exists($cachepath))