Issues

ZF-9225: Zend_Filter_Inflector:>setConfig() throws the exception 'Zend_Loader_PluginLoader_Exception'

Issue Type: Bug Created: 2010-02-21T16:24:21.000+0000 Last Updated: 2010-03-07T11:59:03.000+0000 Status: Resolved Fix version(s): - 1.10.3 (01/Apr/10)

Reporter: Ramon Henrique Ornelas (ramon) Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter_Inflector

Related issues: - ZF-8997

Attachments: - ZF-9225.zip

Description

Zend_Filter_Inflector:>setConfig(), problem to set the option 'filterPrefixPath'. Zend_Filter_Inflector:>addFilterPrefixPath(), should be called before of Zend_Filter_Inflector:>addRules($value);

case

<pre class="highlight">
$options = array(
    'target' => ':controller/:action',
    'rules'  => array(
        ':action'     => 'Custom',
        ':controller' => 'Word_CamelCaseToDash'
    ),
    'filterPrefixPath' => array('My_Filter_' => 'My/Filter/')
);

new Zend_Filter_Inflector(new Zend_Config($options));

Will cause an exception because the configuration of the path is after setting the 'rules'. See line 508 in Zend_Filter_Inflector.

Comments

Posted by Ramon Henrique Ornelas (ramon) on 2010-02-21T16:49:32.000+0000

code reproduced in ZF-9225.zip

Posted by Thomas Weidner (thomas) on 2010-03-07T01:45:37.000+0000

@Ramon: Why did you attach this issue manually to me?

Posted by Thomas Weidner (thomas) on 2010-03-07T01:49:25.000+0000

Example and Description Header do not match... In non of your examples "setConfig()" is called.

This method is deprecated and will not be called by the Inflector itself.

Posted by Ramon Henrique Ornelas (ramon) on 2010-03-07T06:22:35.000+0000

@Thomas Attaches to you because you were looking at the issue ZF-8997 ;). With the resolution of the issue ZF-8997, Zend_Filter_Inflector:>setConfig() has become obsolete.

But this occurs in Zend_Filter_Inflector:> setOptions() also.

No problem

<pre class="highlight">
$options = array(
    'target' => ':controller/:action',
    'filterPrefixPath' => array('My_Filter_' => 'My/Filter/')
    'rules'  => array(
       ':action'     => 'Custom',
       ':controller' => 'Word_CamelCaseToDash'
     ), 
);
Zend_Filter_Inflector:>setOptions($options);

Problem

<pre class="highlight">
$options = array(
    'target' => ':controller/:action',
    'rules'  => array(
       ':action'     => 'Custom',
       ':controller' => 'Word_CamelCaseToDash'
     ),
    'filterPrefixPath' => array('My_Filter_' => 'My/Filter/')
);
Zend_Filter_Inflector:>setOptions($options);

Posted by Thomas Weidner (thomas) on 2010-03-07T11:59:03.000+0000

Fixed with r21372

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts