Welcome Guest, Not a member yet? Register   Sign In
Does Image Manipulation class work with Blobs?
#11

[eluser]peterbz[/eluser]
[quote author="xwero" date="1239191375"]you can use a cron to do it[/quote]
So that means I'll have to store the time of each cache in the database? Wouldn't that add to the overhead?
#12

[eluser]xwero[/eluser]
No you can do the check using the php file functions
Code:
$files = glob('path/to/cache/*');
foreach($files as $file)
{
   if(filemtime($file) < strtotime('-24 hour'))
   {
      unlink($file);
   }
}
#13

[eluser]peterbz[/eluser]
I know how to output a blob as an image (you set the headers), but how would you actually save it as an image (to the cache folder)?
#14

[eluser]xwero[/eluser]
just put the content of the blob in the file and name it appropriately. the header setting is because php is outputted as text/html by default.
#15

[eluser]peterbz[/eluser]
[quote author="xwero" date="1239195289"]just put the content of the blob in the file and name it appropriately. the header setting is because php is outputted as text/html by default.[/quote]

I don't quite understand. Can you please give example?
#16

[eluser]xwero[/eluser]
Code:
file_put_contents('path/to/cache/blobname.extension', $this->model->get_blob($id));




Theme © iAndrew 2016 - Forum software by © MyBB