See
https://github.com/zendframework/zf2/blob/release-2.2.0/library/Zend/InputFilter/InputFilterPluginManager.php#L33-L38

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On 17 June 2013 11:42, Ralf Eggert <[email protected]> wrote:

> Hi,
>
> I added an initializer for the InputFilterPluginManager like this:
>
> ---------------------------------------------------------------------
> return array(
>     'input_filters' => array(
>         'initializers'=> array(
>             'CsrfInput'  => 'MyLib\InputFilter\CsrfInputInitializer',
>         ),
>     ),
> );
> ---------------------------------------------------------------------
>
> The initializer class looks this:
>
> ---------------------------------------------------------------------
> namespace MyLib\InputFilter;
>
> use Zend\ServiceManager\InitializerInterface;
> use Zend\ServiceManager\ServiceLocatorInterface;
>
> class CsrfInputInitializer implements InitializerInterface
> {
>     public function initialize(
>         $instance, ServiceLocatorInterface $serviceLocator
>     ) {
>         \Zend\Debug\Debug::dump(get_class($instance));
>     }
> }
> ---------------------------------------------------------------------
>
> When I run this my class "User\InputFilter\ProfileFilter" is dumped
> twice. Even all other input filter classes are dumped twice.
>
> When I add the following line:
>
> \Zend\Debug\Debug::dump(spl_object_hash($instance));
>
> I get different hashes for each call of the initializer. So two objects
> are created although my input filters are not defined as "shared" = false.
>
> Is this a bug or a feature?
>
> Thanks,
>
> Ralf
>
> --
> List: [email protected]
> Info: http://framework.zend.com/archives
> Unsubscribe: [email protected]
>
>
>

Reply via email to