Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

handler class cannot be loaded

Hi, I have weired problem!

I have multilanguage multimodule phalcon mvc system. all langs works well & all controllers & routes ok. but in 2 of langs e.g. 'tr' and 'az', handler class cannot be loaded!

This is so weired that dispatcher looking for indexController instead of IndexController !!!

Client\Controllers\indexController handler class cannot be loaded

when i put indexController.php file with lowercase name, it works! but again for other controllers it looks for lowercase version!


I found the source of problem! when i comment locale part of bootstrap (putenv, bindtextdomain, bindtextdomaincodeset functions), it going to be ok! i dont know why az_AZ or tr_TR make problem! any one knows?


After quick research it turned out that it’s actually known bug, yet still not fixed since 2002! See #18556. In short, PHP simply uses internal tolower() function, which is locale-aware, but in Turkish there are some specific rules for I (undotted ı is the lowercase of I, and the dotted İ is the uppercase of i). So if you have class name of method name having upper I (newInstanceArgs, Image, etc), you’re affected.

The only workaround for now seems to be setting LCCTYPE to some working locale, eg. setlocale(LCALL, 'trTR'); setlocale(LCCTYPE, 'en_US');.

edited Jan '16

use LCMESSAGES instead of LCALL:

setlocale(LC_MESSAGES, "az_AZ.UTF-8");