Take the 2-minute tour ×

Today I was moving a CakePHP app that I made on windows to my new macbook. For some weird reason one model doesn't load properly. Other models do load properly though, which confuses me... I got this error:

Fatal error: Call to undefined method Locale::getLocale() in /server/cakephp/app/Controller/AppController.php on line 59

That line is just calling a method in my Locale model that I have. So I tried to see what $this->Locale looked like with this code:


And this was the result:

Locale Object

I don't know why, but apparently I get an empty object. I tried removing the Locale.php file to see if CakePHP would automatically use AppModel, but it still becomes an empty object. So I tried searching if I have some empty class called Locale somewhere, but I couldn't find it.

Please help, this is so frustrating!

I cloned the CakePHP library from git yesterday, maybe that's useful information? Could it be that Locale has suddenly become a reserved word?

share|improve this question
Check your cases. Don't forget that Windows isn't case sensitive and OS X is CaSe SenSitIvE. Either that, or it's a routing issue. Check your code for anywhere you've hard coded a \ instead of a /. As you should be using the DS constant. –  DavidYell Nov 20 '12 at 17:10
I've always followed the cases conventions and I just double-checked it, they are fine. Also I haven't found a \ anywhere where it should be DS. –  Evert Nov 20 '12 at 17:28
add comment

1 Answer

Permissions maybe? I've also had troubles in the past with hidden .files when moving cakephp apps, worth checking. I'm guessing that git handles both correctly though.

share|improve this answer
add comment

Your Answer


