Re: [fw-general] Image captcha, remove files

2009-07-28 Thread Carlton Gibson


On 28 Jul 2009, at 13:55, Tim Fountain wrote:



2009/7/28 PHPScriptor 

Maybe a simple question, but I never did this before. How can I  
remove the

old image-captcha's from my directory?

I believe the component does this automatically. You can control how  
frequently it does so by changing the garbage collection frequency  
config options - see  http://framework.zend.com/manual/en/zend.captcha.adapters.html#zend.captcha.adapters.image


The default value is 100, so 1 in 100 of the captcha requests will  
also remove the old images.


You could probably setup a cron job to do this but I don't think it  
would be worth the hassle unless your site gets a very high amount  
of traffic and you're seeing slowdown issues on the captcha  
generation.


Scratch my last response. If the component does it itself, that's  
easier. ;-)


Regards,
Carlton

Re: [fw-general] Image captcha, remove files

2009-07-28 Thread Carlton Gibson

Hi there,

On 28 Jul 2009, at 13:41, PHPScriptor wrote:
Maybe a simple question, but I never did this before. How can I  
remove the
old image-captcha's from my directory? How can this be done  
efficiently?
Can this be done with Zend Framework? Or do I need to run a cronjob  
every

night? ...


The easiest way to do this is probably just via a shell script run via  
cron.


Assuming all image-captchas live in the same file (with nothing else)  
you can just do something like:


#! /bin/bash
cd /my/image/captcha/directory;
if (( $? == 0 )); then rm * ; fi

(The conditional just checks that the cd command worked -- otherwise  
you could be rm-ing all sorts of things.)


Hope that helps.

Regards,
Carlton




Re: [fw-general] Image captcha, remove files

2009-07-28 Thread Tim Fountain
2009/7/28 PHPScriptor 

>
> Maybe a simple question, but I never did this before. How can I remove the
> old image-captcha's from my directory?


I believe the component does this automatically. You can control how
frequently it does so by changing the garbage collection frequency config
options - see
http://framework.zend.com/manual/en/zend.captcha.adapters.html#zend.captcha.adapters.image

The default value is 100, so 1 in 100 of the captcha requests will also
remove the old images.

You could probably setup a cron job to do this but I don't think it would be
worth the hassle unless your site gets a very high amount of traffic and
you're seeing slowdown issues on the captcha generation.

-- 
Tim Fountain
http://tfountain.co.uk/


[fw-general] Image captcha, remove files

2009-07-28 Thread PHPScriptor

Hello,

Maybe a simple question, but I never did this before. How can I remove the
old image-captcha's from my directory? How can this be done efficiently?
Can this be done with Zend Framework? Or do I need to run a cronjob every
night? ...

-
visit my website at  http://www.phpscriptor.com/ http://www.phpscriptor.com/ 
-- 
View this message in context: 
http://www.nabble.com/Image-captcha%2C-remove-files-tp24698049p24698049.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Image captcha, remove files

2009-07-28 Thread PHPScriptor

Hello,

Maybe a simple question, but I never did this before. How can I remove the
old image-captcha's from my directory? How can this be done efficiently?
Can this be done with Zend Framework? Or do I need to run a cronjob every
night? ...

-
visit my website at  http://www.phpscriptor.com/ http://www.phpscriptor.com/ 
-- 
View this message in context: 
http://www.nabble.com/Image-captcha%2C-remove-files-tp24698047p24698047.html
Sent from the Zend Framework mailing list archive at Nabble.com.