PHP Classes

Not Cleaning Old Images

Recommend this page to a friend!

      HN CAPTCHA  >  All threads  >  Not Cleaning Old Images  >  (Un) Subscribe thread alerts  
Subject:Not Cleaning Old Images
Summary:Option to limit number of image.
Messages:2
Author:Roah Nosh
Date:2010-11-24 10:14:16
Update:2010-11-24 12:39:04
 

  1. Not Cleaning Old Images   Reply   Report abuse  
Picture of Roah Nosh Roah Nosh - 2010-11-24 10:14:16
It works great. this is far more consistent than other captcha out there. Now my only problem is that my temporary directory is stocking up a lot of images when the page is refreshed.

Is there a way to delete past images?

please mail me @ brixter.deleon@paper-soup.com

  2. Re: Not Cleaning Old Images   Reply   Report abuse  
Picture of Horst Nogajski Horst Nogajski - 2010-11-24 12:39:04 - In reply to message 1 from Roah Nosh
Hi,

you can use the class-extension within the package to achive that:

"hn_captcha_X1"

(class hn_captcha_X1 extends hn_captcha)

* This class is an extension for hn_captcha-class. It adds a garbage-collector!
*
* Normally all used images will be deleted automatically. But everytime a user
* doesn't finish a request one image stays as garbage in tempfolder.
* With this extension you can collect & trash this.
*
* You can specify:
* - when the garbage-collector should run, (default = after 100 calls)
* - the maxlifetime for images, (default is 600, = 10 minutes)
* - a filename-prefix for the captcha-images (default = 'hn_captcha_')
* - absolute filename for a textfile which stores the current counter-value
* (default is $tempfolder.'hn_captcha_counter.txt')

... (read on in the classfile itself)

Best regards,
Horst