ZF-8412: Unhelpful error message if configuration is wrong
Description
If I put in application.ini (generated by standard zf create project) the following line:
resources.frontcontroller.blah = 1
(note the lowercase 'c' in frontcontroller) then I get this error:
PHP Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'No default controller directory registered with front controller' in C:\Projects\framework\library\Zend\Application\Bootstrap\Bootstrap.php:71 Stack trace:
0 C:\Projects\framework\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
Now, I understand this is probably caused by some problem parsing configuration that can't be properly displayed - however it would be much nicer if I could get it from the error message, since "No default controller directory" give little hint what is really wrong there.
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2009-11-28T06:15:05.000+0000
Options that the FrontController resource doesn't understand are simply ignored, and no error messages raised. What you're encountering is spelled out in the error message: you haven't specified any controller directories in your configuration.
We could update the documentation for the FrontController bootstrap resource to indicate that you must minimally have the following:
Would that solve the issue for you? (BTW, Zend_Tool sets this for you when you create a project...)
Posted by Stanislav Malyshev (stas) on 2009-11-28T19:41:13.000+0000
No, that's not right. The directive you quoted IS present in the config file. Also, as I noted, everything works just fine if I remove the "bad" directive - so, obviously, FC has everything it needs for normal function in the .ini file, absent the "bad" directive.
The error apprears ONLY when the bad directive is ADDED to otherwise working setup.
And yes, I used Zend_Tool to generate it, as I noted (zf create project).
Another thing - if I use frontController in the name (with capital C) the "blah" directive just does nothing and only case where error appears is if I write frontcontroller with lowercase 'c'.
Posted by Richard Tuin (richardtuin) on 2010-11-20T06:09:07.000+0000
Added a Unit Test to prove this is not an issue in the current revision.
I hope this helps resolving this issue.
Posted by Ramon Henrique Ornelas (ramon) on 2011-01-01T07:26:35.000+0000
@rtuin The problem mentioned by @stas is this.
In this case should be done merged of arrays, before of the called Zend_Application_Bootstrap_BootstrapAbstract::registerPluginResource() line 142.
Greetings Ramon