Re: [fw-general] Routing problems - Invalid controller specified
Is there a way to solve this (without having to rename) ? I am facing Action dosomething does not exist and was not trapped in __call() under my mac. The action is called doSomethingAction, the URL points to doSomething but I can't make it work without renaming to dosomethingAction. On Wed, Aug 15, 2007 at 6:55 AM, Greg Frith [EMAIL PROTECTED] wrote: Thanks Simon. Of course. For the benefit of the thread, my first server is OS X using the OSX Extended filesystem, which preserves case but isn't case sensitive. The second server is Ubuntu using ext3 filesystem which is case sensitive. I should have spotted this earlier! Now for a bit of re-naming! Beware to those developing on OS X! Many thanks, Greg. On 15 Aug 2007, at 09:34, Simon Mundy wrote: No great magic here - your first server is obvious case-insensitive for filenames and the second is not. The router uses CamelCase for its class names, but the _whole_ controller name is turned into word case for the sake of consistency. So MyNewRssController should really be written as MynewrssController in both the filename and the class declaration. Cheerio It works! I didn't think this one was going to be so simple to solve! Well kind of, so why is one box treating case differently to another?? I'll have to carefully read the docs on naming conventions. Thanks Simon. On 15 Aug 2007, at 08:50, Simon Mundy wrote: Hi Greg What happens on the new box if you have 'ComingsoonController.php' (with the lowercase 's') and the class is named 'ComingsoonController'? Could anyone suggest any where I might start looking and debugging further? Perhaps somewhere where the actual path to the action controller is generated and an attempt is made to instantiate the class might give me some clues as to what's going wrong? -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com Many thanks, -- Greg Frith DGFSolutions - Independent IT Consultancy, Troubleshooting and Development [EMAIL PROTECTED] : +44 7970 925 257 MSN: [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] Skype: gregfrith -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com Many thanks, -- Greg Frith DGFSolutions - Independent IT Consultancy, Troubleshooting and Development [EMAIL PROTECTED] : +44 7970 925 257 MSN: [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] Skype: gregfrith
[fw-general] Routing problems - Invalid controller specified
Hi all, I'm having some routing problems which I don't necessarily think the group are going to be able to answer directly, but maybe give me some pointers as to how I may debug further. I have developed a site on my local machine where everything is working just fine. Yesterday I copied the site over to a second development server for my colleagues to start reviewing. However, on the development server I'm getting an awful lot of Zend_Controller_Dispatcher_Exception exceptions thrown with the message 'Invalid controller specified (controller name). I say an awful lot as not every request results in this. My default index controller works fine, as does my Book controller, but all others fail (please note that book controller is the real thing, and not a typical library book example file! Its part of a booking process). My directory structure is as follows: www/application/ www/application/config/ www/application/modules/ www/application/modules/default/ www/application/modules/default/controller/ www/application/modules/default/controller/BookController.php www/application/modules/default/controller/ComingSoonController.php www/application/modules/default/controller/IndexController.php www/application/modules/default/controller/StaticPagesController.php www/application/modules/default/views/ www/application/templates/ www/htdocs/ - doc root As I say, the BookController and IndexController work fine, but ComingSoonController and StaticPagesController are not found. During a request for /comingsoon/index the request object looks like this: 2007-08-15T08:03:32+01:00 DEBUG (7): Zend_Controller_Request_Http Object ( [_requestUri:protected] = /default/ComingSoon/index/ [_baseUrl:protected] = [_basePath:protected] = [_pathInfo:protected] = /default/ComingSoon/index/ [_params:protected] = Array ( [module] = default [controller] = ComingSoon [action] = index ) [_aliases:protected] = Array ( ) [_dispatched:protected] = 1 [_module:protected] = default [_moduleKey:protected] = module [_controller:protected] = ComingSoon [_controllerKey:protected] = controller [_action:protected] = index [_actionKey:protected] = action ) So the correct modules, controller and action parameters are being taken from the URL. All the controllers are working fine with exactly the same code on a local development machine. The only real difference being the the development machine has a local hostname and uses Apache Virtual Hosts, whereas the new testing server on which the site fails is accessed over the internet via its IP address. There is no domain registered against it. Some relevant lines from my bootstrap: // Get front controller $controller = Zend_Controller_Front::getInstance(); $modules = array('default',$modulesDir/default/controller/); $controller-setControllerDirectory($modules); * NOTE THE ABOVE LINES HAVE BEEN ADDED TO TRY AND RESOLVE THE ISSUE, THEY WERE NOT REQUIRED ON THE WORKING SERVER * // Add some additional routes - if we keep these they should come from a config $router = $controller-getRouter(); $router-addRoute('shows', new Zend_Controller_Router_Route ('shows/:event', array('controller'='findashow','action'='showInfo'))); $router-addRoute('InsiderTips',new Zend_Controller_Router_Route ('insidertips/:article', array('controller'='staticPages', 'artion'='index', 'article'='insidertips', 'category'='insidertips'))); $router-addRoute('whyus',new Zend_Controller_Router_Route ('whyus/:article', array('controller'='staticPages', 'artion'='index', 'article'='whyus', 'category'='whyus'))); $router-addRoute('whybookapackage',new Zend_Controller_Router_Route ('whybookapackage/:article', array('controller'='staticPages', 'artion'='index', 'article'='whybookapackage', 'category'='whybookapackage'))); Could anyone suggest any where I might start looking and debugging further? Perhaps somewhere where the actual path to the action controller is generated and an attempt is made to instantiate the class might give me some clues as to what's going wrong? Many thank, Greg Frith.
Re: [fw-general] Routing problems - Invalid controller specified
Hi Greg What happens on the new box if you have 'ComingsoonController.php' (with the lowercase 's') and the class is named 'ComingsoonController'? Could anyone suggest any where I might start looking and debugging further? Perhaps somewhere where the actual path to the action controller is generated and an attempt is made to instantiate the class might give me some clues as to what's going wrong? -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com
Re: [fw-general] Routing problems - Invalid controller specified
It works! I didn't think this one was going to be so simple to solve! Well kind of, so why is one box treating case differently to another?? I'll have to carefully read the docs on naming conventions. Thanks Simon. On 15 Aug 2007, at 08:50, Simon Mundy wrote: Hi Greg What happens on the new box if you have 'ComingsoonController.php' (with the lowercase 's') and the class is named 'ComingsoonController'? Could anyone suggest any where I might start looking and debugging further? Perhaps somewhere where the actual path to the action controller is generated and an attempt is made to instantiate the class might give me some clues as to what's going wrong? -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com Many thanks, -- Greg Frith DGFSolutions - Independent IT Consultancy, Troubleshooting and Development [EMAIL PROTECTED] : +44 7970 925 257 MSN: [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] Skype: gregfrith
Re: [fw-general] Routing problems - Invalid controller specified
No great magic here - your first server is obvious case-insensitive for filenames and the second is not. The router uses CamelCase for its class names, but the _whole_ controller name is turned into word case for the sake of consistency. So MyNewRssController should really be written as MynewrssController in both the filename and the class declaration. Cheerio It works! I didn't think this one was going to be so simple to solve! Well kind of, so why is one box treating case differently to another?? I'll have to carefully read the docs on naming conventions. Thanks Simon. On 15 Aug 2007, at 08:50, Simon Mundy wrote: Hi Greg What happens on the new box if you have 'ComingsoonController.php' (with the lowercase 's') and the class is named 'ComingsoonController'? Could anyone suggest any where I might start looking and debugging further? Perhaps somewhere where the actual path to the action controller is generated and an attempt is made to instantiate the class might give me some clues as to what's going wrong? -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com Many thanks, -- Greg Frith DGFSolutions - Independent IT Consultancy, Troubleshooting and Development [EMAIL PROTECTED] : +44 7970 925 257 MSN: [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] Skype: gregfrith -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com
Re: [fw-general] Routing problems - Invalid controller specified
Thanks Simon. Of course. For the benefit of the thread, my first server is OS X using the OSX Extended filesystem, which preserves case but isn't case sensitive. The second server is Ubuntu using ext3 filesystem which is case sensitive. I should have spotted this earlier! Now for a bit of re-naming! Beware to those developing on OS X! Many thanks, Greg. On 15 Aug 2007, at 09:34, Simon Mundy wrote: No great magic here - your first server is obvious case-insensitive for filenames and the second is not. The router uses CamelCase for its class names, but the _whole_ controller name is turned into word case for the sake of consistency. So MyNewRssController should really be written as MynewrssController in both the filename and the class declaration. Cheerio It works! I didn't think this one was going to be so simple to solve! Well kind of, so why is one box treating case differently to another?? I'll have to carefully read the docs on naming conventions. Thanks Simon. On 15 Aug 2007, at 08:50, Simon Mundy wrote: Hi Greg What happens on the new box if you have 'ComingsoonController.php' (with the lowercase 's') and the class is named 'ComingsoonController'? Could anyone suggest any where I might start looking and debugging further? Perhaps somewhere where the actual path to the action controller is generated and an attempt is made to instantiate the class might give me some clues as to what's going wrong? -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com Many thanks, -- Greg Frith DGFSolutions - Independent IT Consultancy, Troubleshooting and Development [EMAIL PROTECTED] : +44 7970 925 257 MSN: [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] Skype: gregfrith -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com Many thanks, -- Greg Frith DGFSolutions - Independent IT Consultancy, Troubleshooting and Development [EMAIL PROTECTED] : +44 7970 925 257 MSN: [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] Skype: gregfrith
RE: [fw-general] Routing problems - Invalid controller specified
This one is very non-intuitive. Class names have their case preserved but file and directory names related to them have not . Class: MyNewRssController File: Mynewrsscontroller.php Views: views/ mynewrsscontroller/myaction.phtml Not sure why this was they decided to do it this way, it took a good look at the code to to convince myself this was deliberate. Craig Duncan From: Simon Mundy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 15, 2007 4:35 AM To: Greg Frith Cc: fw-general@lists.zend.com Subject: Re: [fw-general] Routing problems - Invalid controller specified No great magic here - your first server is obvious case-insensitive for filenames and the second is not. The router uses CamelCase for its class names, but the _whole_ controller name is turned into word case for the sake of consistency. So MyNewRssController should really be written as MynewrssController in both the filename and the class declaration. Cheerio It works! I didn't think this one was going to be so simple to solve! Well kind of, so why is one box treating case differently to another?? I'll have to carefully read the docs on naming conventions. Thanks Simon. On 15 Aug 2007, at 08:50, Simon Mundy wrote: Hi Greg What happens on the new box if you have 'ComingsoonController.php' (with the lowercase 's') and the class is named 'ComingsoonController'? Could anyone suggest any where I might start looking and debugging further? Perhaps somewhere where the actual path to the action controller is generated and an attempt is made to instantiate the class might give me some clues as to what's going wrong? -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com http://www.peptolab.com/ Many thanks, -- Greg Frith DGFSolutions - Independent IT Consultancy, Troubleshooting and Development [EMAIL PROTECTED] : +44 7970 925 257 MSN: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Skype: gregfrith -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com http://www.peptolab.com/
Re: [fw-general] Routing problems - Invalid controller specified
On 8/15/07, Duncan, Craig [EMAIL PROTECTED] wrote: This one is very non-intuitive. Class names have their case preserved but file and directory names related to them have not . Class: MyNewRssController File: Mynewrsscontroller.php Views: views/ mynewrsscontroller/myaction.phtml Not sure why this was they decided to do it this way, it took a good look at the code to to convince myself this was deliberate. Craig Duncan hi Craig, i ever asked the similar question in the past. this is mainly because of convention so we'll just have to stick with it. if you investigate Zend_Controller component, you'll find the reason for the convention. regards, Mike
Re: [fw-general] Routing problems - Invalid controller specified
-- Greg Frith [EMAIL PROTECTED] wrote (on Wednesday, 15 August 2007, 08:44 AM +0100): Hi all, I'm having some routing problems which I don't necessarily think the group are going to be able to answer directly, but maybe give me some pointers as to how I may debug further. I have developed a site on my local machine where everything is working just fine. Yesterday I copied the site over to a second development server for my colleagues to start reviewing. However, on the development server I'm getting an awful lot of Zend_Controller_Dispatcher_Exception exceptions thrown with the message 'Invalid controller specified (controller name). I say an awful lot as not every request results in this. My default index controller works fine, as does my Book controller, but all others fail (please note that book controller is the real thing, and not a typical library book example file! Its part of a booking process). My directory structure is as follows: www/application/ www/application/config/ www/application/modules/ www/application/modules/default/ www/application/modules/default/controller/ www/application/modules/default/controller/BookController.php www/application/modules/default/controller/ComingSoonController.php www/application/modules/default/controller/IndexController.php www/application/modules/default/controller/StaticPagesController.php www/application/modules/default/views/ www/application/templates/ www/htdocs/ - doc root As I say, the BookController and IndexController work fine, but ComingSoonController and StaticPagesController are not found. During a request for /comingsoon/index the request object looks like this: You should request these using a word separator ('.' or '-') in the URL between the invidual words in the controller name (indicated by CamelCasing): /coming-soon/... /static-pages/... -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Routing problems - Invalid controller specified
-- Simon Mundy [EMAIL PROTECTED] wrote (on Wednesday, 15 August 2007, 06:34 PM +1000): No great magic here - your first server is obvious case-insensitive for filenames and the second is not. The router uses CamelCase for its class names, but the _whole_ controller name is turned into word case for the sake of consistency. So MyNewRssController should really be written as MynewrssController in both the filename and the class declaration. Not entirely true. You can keep the CamelCasing in the filename and classname, but you need to separate the words with a word separator ('.', '-') in the URL: /my-new-rss/action or /my.new.rss/action. It works! I didn't think this one was going to be so simple to solve! Well kind of, so why is one box treating case differently to another?? I'll have to carefully read the docs on naming conventions. Thanks Simon. On 15 Aug 2007, at 08:50, Simon Mundy wrote: Hi Greg What happens on the new box if you have 'ComingsoonController.php' (with the lowercase 's') and the class is named 'ComingsoonController'? Could anyone suggest any where I might start looking and debugging further? Perhaps somewhere where the actual path to the action controller is generated and an attempt is made to instantiate the class might give me some clues as to what's going wrong? -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com Many thanks, -- Greg Frith DGFSolutions - Independent IT Consultancy, Troubleshooting and Development [EMAIL PROTECTED] : +44 7970 925 257 MSN: [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] Skype: gregfrith -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Routing problems - Invalid controller specified
-- Duncan, Craig [EMAIL PROTECTED] wrote (on Wednesday, 15 August 2007, 10:17 AM -0400): This one is very non-intuitive. Class names have their case preserved but file and directory names related to them have not . Class: MyNewRssController File: Mynewrsscontroller.php Views: views/ mynewrsscontroller/myaction.phtml Not sure why this was they decided to do it this way, it took a good look at the code to to convince myself this was deliberate. There's several issues at play here: * PHP treats class names as case-insensitive * Some developers want CamelCased names * If you use a CamelCasedName class name, the actual file name needs to match in order to follow coding standards and allow for autodiscovery. So, you *can* have the following: * Class: MyNewRssController * File: MyNewRssController.php For the router and dispatcher to successfully call it, however, you need to separate the CamelCasedWords on the URL using word delimiters -- a dash or a period: /my-new-rss/action /my.new.rss/action /my-new.rss/action ━━━ From: Simon Mundy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 15, 2007 4:35 AM To: Greg Frith Cc: fw-general@lists.zend.com Subject: Re: [fw-general] Routing problems - Invalid controller specified No great magic here - your first server is obvious case-insensitive for filenames and the second is not. The router uses CamelCase for its class names, but the _whole_ controller name is turned into word case for the sake of consistency. So MyNewRssController should really be written as MynewrssController in both the filename and the class declaration. Cheerio It works! I didn't think this one was going to be so simple to solve! Well kind of, so why is one box treating case differently to another?? I'll have to carefully read the docs on naming conventions. Thanks Simon. On 15 Aug 2007, at 08:50, Simon Mundy wrote: Hi Greg What happens on the new box if you have 'ComingsoonController.php' (with the lowercase 's') and the class is named 'ComingsoonController'? Could anyone suggest any where I might start looking and debugging further? Perhaps somewhere where the actual path to the action controller is generated and an attempt is made to instantiate the class might give me some clues as to what's going wrong? -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com Many thanks, -- Greg Frith DGFSolutions - Independent IT Consultancy, Troubleshooting and Development [EMAIL PROTECTED] : +44 7970 925 257 MSN: [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] Skype: gregfrith -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/