ZF-11439: Zend_Tool produces incorrect controller class name when module name contains hyphen
Description
If you run:
zf create module test-mod
zf create controller Index index-action-included[=1] test-mod
You'll get an error:
Parse error: parse error, expecting '{' ... and you get a file with the invalid class name: Test-mod_IndexController
Expected name would be: TestMod_IndexController which would be accessed by http://project/test-mod
Comments
Posted by Adam Lundrigan (adamlundrigan) on 2011-06-04T23:56:23.000+0000
Reproduced issue against trunk:
Received this error message:
Posted by Adam Lundrigan (adamlundrigan) on 2011-06-05T00:29:57.000+0000
Issue can be fixed by applying filter Zend_Filter_Word_DashToCamelCase in ControllerFile and TestApplicationControllerFile contexts:
Posted by Adam Lundrigan (adamlundrigan) on 2011-06-05T00:35:26.000+0000
Fixed in trunk r24120
Posted by Adam Lundrigan (adamlundrigan) on 2011-06-05T00:59:54.000+0000
Problem also affects the following contexts: * DbTableFile (zf create db-table -> class Test-mod_Model_DbTable_Test extends Zend_Db_Table_Abstract) * FormFile (zf create form -> class Test-mod_Form_Test extends Zend_Form) * ModelFile (zf create model -> class Test-mod_Model_Test)
All of which rely upon AbstractClassFile context to create their class names.
Fix is to apply Zend_Filter_Word_DashToCamelCase in AbstractClassFile:
Posted by Adam Lundrigan (adamlundrigan) on 2011-06-05T01:01:34.000+0000
Additional fix added to trunk r24121
Posted by Adam Lundrigan (adamlundrigan) on 2011-06-28T16:42:29.000+0000
Merged to release-1.11 in r24161