We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Letters case in name of files and folders

Hi all, I have really strange problem here. On my vagrant instance I use folders 'controllers' and 'models' but on production server it works only when I rename folders to 'Controllers' and 'Models'. Both servers on Ubuntu 14.04 with case sensitive ext4. I use class loader by namespace like this:

$loader->registerNamespaces(array(
    'MyApp' => __DIR__ . '/',
    'PhpAmqpLib' => __DIR__ . '/../vendor/PhpAmqpLib'
));

How can it be? =)

The answer: It turns that vagrant sync folders doesn't support case sensitive filenames if it is not supported on the host. Sorry. =(



2.1k
Accepted
answer

Okey, extended answer is:

Vagrants 'sync folders' supports case sensitive filenames only if filesystems of both host and virtual mashines are case sensitive. That's why you should use linux as host =)

Next problem is that git doesn't care about case. So, when I perform pull on production server it downloads files and folders in lower case that cause known problems. So I used next command:

git mv controllers _controllers
git mv _controllers Controllers

to rename folders in git and now everything is okey.

Hope it will help somebody =)