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
Posted by Daniel Müller (damu) on 2012-08-16T15:08:29.000+0000
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.
Posted by Matthew Weier O'Phinney (matthew) on 2012-08-16T15:08:39.000+0000
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.
Posted by Daniel Müller (damu) on 2012-08-16T15:13:56.000+0000
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.