Issues

ZF2-472: ReCaptcha throws Fatal error: Class 'ZendService\ReCaptcha\ReCaptcha' not found

Description

ReCaptcha references a non-existant class and namespace ZendService\ReCaptcha\ReCaptcha.

Reproduce


$cap = new \Zend\Captcha\ReCaptcha();
$capElem = new \Zend\Form\Element\Captcha();
$capElem->setCaptcha($cap);

Comments

Just realized that this has been exported to another repos. However, it should be communicated somehow that you have to include an extern repos in order to use a core component.

Have you installed ZendService\ReCaptcha? It must be installed in order for that captcha adapter to work.

The repository is here: https://github.com/zendframework/…

You can add it to composer using the package name "zendframework/zendservice-recaptcha", or via pyrus using the package name "zendservicerecaptcha". Alternately, grab a tarball/zipball from the git repository, unpack it, and add autoloader configuration that will pick it up.

In case you haven't seen my previous comment, I think it would be helpful to explicitly catch this case and at least throw a customized exception. Thus, the developer will know he failed to install a dependency.