-- Karl Katzke <[EMAIL PROTECTED]> wrote
(on Wednesday, 05 March 2008, 04:35 PM -0600):
> Is PHP 5.1.6 still supported with ZF, or not? If it is, I seem to be having an
> issue with the autoloader.
> 
> On my local workstation, which is running 5.2.3, I can autoload classes in the
> Validator folder just fine. When I try with my server running PHP 5.1.6, I'll
> get a stack trace akin to this:
> 
> 2008-03-05T16:24:29-06:00 DEBUG (7): Plugin by name Notempty was not found in
> the registry.
> #0 /var/www/mansites/corpworlds.com/lib/Zend/Form/Element.php(909):
> Zend_Loader_PluginLoader->load('notempty')

This is the problem: use 'notEmpty' or 'NotEmpty' when referring to the
validator; otherwise, the plugin loader associated with
Zend_Form_Element won't find the class, as class names and file names
are case sensitive ('notempty' resolves to 'Zend_Validate_Notempty',
versus 'notEmpty' or 'NotEmpty' which both resolve to
'Zend_Validate_NotEmpty').

> #1 /var/www/mansites/corpworlds.com/lib/Corpworlds/Form/Quickregister.php(31):
> Zend_Form_Element->addValidator('notempty', true)
> #2 /var/www/mansites/corpworlds.com/app/controllers/UserController.php(18):
> Corpworlds_Form_Quickregister->__construct()
> #3 /var/www/mansites/corpworlds.com/lib/Zend/Controller/Action.php(502):
> UserController->quickregisterAction()
> #4 
> /var/www/mansites/corpworlds.com/lib/Zend/Controller/Dispatcher/Standard.php
> (293): Zend_Controller_Action->dispatch('quickregisterAc...')
> #5 /var/www/mansites/corpworlds.com/lib/Zend/Controller/Front.php(914):
> Zend_Controller_Dispatcher_Standard->dispatch(Object
> (Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
> #6 /var/www/mansites/corpworlds.com/lib/Zend/Controller/Front.php(223):
> Zend_Controller_Front->dispatch()
> #7 /var/www/mansites/corpworlds.com/html/index.php(32):
> Zend_Controller_Front::run('/var/www/mansit...')
> #8 {main}
> 
> ... but if I add a line like this in the front controller, it picks up the
> NotEmpty validator just fine:
> 
>  $ne = new Zend_Validate_NotEmpty();
> 
> ... Like I said, not sure if this is a bug or something that I should know how
> to work around. Still just using forms and validators for the first time.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to