Zend Framework

Zend_Captcha factory class

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Zend_Captcha
  • Labels:
    None

Description

I'm really wondered why there isn't any Factory object for this component. It will be very usefully to have such factory that connected with Zend_Config can make our life and project management much more easier. So i decided to write one.

It's based on Zend_Cache::factory, and except ReCaptcha it works well. With ReCaptcha there is small problem with isValid method - it has different syntax, and without changing isValid part inside your code you can't easy change from eg. Zend_Captcha_Image to Zend_Captcha_ReCaptcha.

Using examples:

$captcha = Zend_Captcha::factory(
           'Mao_Captcha_FigletCopy',
           array(
               'name'         => 'foo',
               'wordLen'    => 6
           )
       );
$captcha = Zend_Captcha::factory(
           'Image',
           array(
               'name'         => 'foo',
               'wordLen'    => 6,
               'font'        => APPLICATION_PATH .'library/html2pdf/font/verdana.ttf',
               'imgDir'     => APPLICATION_PATH .'public_html/temp/',
               'imgUrl'    => '/temp/'
           )
       );

I hope that one of ZF developer can take a look at it and include such kind of Zend_Captcha::factory into ZF.

Activity

Hide
Krzysztof Szatanik added a comment -

Zend_Captcha factory suggestion

Show
Krzysztof Szatanik added a comment - Zend_Captcha factory suggestion
Hide
Stanislav Malyshev added a comment -

ivValid seems to have the same signature on both Zend_Captcha_Word and Zend_Captcha_Recaptcha:

public function isValid($value, $context = null)

could you clarify what did you mean?

Show
Stanislav Malyshev added a comment - ivValid seems to have the same signature on both Zend_Captcha_Word and Zend_Captcha_Recaptcha: public function isValid($value, $context = null) could you clarify what did you mean?

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated: