I'm trying to use a native class (SphinxClient installed via PECL) with the
dependency injector to set the server:

'definition' => array(
        'class' => array(
                'SphinxClient' => array(
                        'methods' => array(
                                'setServer' => array(
                                        'host' => array(
                                                'type' => false,
                                                'required' => true
                                        ),
                                        'port' => array(
                                                'type' => false,
                                                'required' => true
                                        ),
                                ),
                        ),
                ),
        ),
),
'instance' => array(
        'SphinxClient' => array(
                'injections' => array(
                        'setServer' => array(
                                'host' => 'localhost',
                                'port' => 3312,
                        ),
                ),
        ),
),

This does not work seem to work, the method is not called. however if I
simply extend it with my own empty class it does.

'definition' => array(
        'class' => array(
                'My\SphinxClient' => array(
                        'methods' => array(
                                'setServer' => array(
                                        'host' => array(
                                                'type' => false,
                                                'required' => true
                                        ),
                                        'port' => array(
                                                'type' => false,
                                                'required' => true
                                        ),
                                ),
                        ),
                ),
        ),
),
'instance' => array(
        'My\SphinxClient' => array(
                'injections' => array(
                        'setServer' => array(
                                'host' => 'localhost',
                                'port' => 3312,
                        ),
                ),
        ),
),

Why won't it work with the native class?

--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/DI-and-native-classes-tp4478165p4478165.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to