lowercase and uppercase file name

4.5k views Asked by At

I used codeigniter framework on my localhost, i named some of my models and controllers using the camel case method(UserModel,DbModel) on windows.Now when i uploaded the files to the server(running on linux) the script is trying to load all the files with all lowercase so i get 404 errors because the script is looking for usermodel not UserModel, any way to go around this ?

3

There are 3 answers

1
Mchl On BEST ANSWER

Welcome to the 'pissed by crippled spl_autoload() implementation' club.

You basically can either

1.Rename all your files to lowercase

or

2.Write/find an autoloader that looks for proper filenames. Here's Symofony's ClassLoader Component which works great.

2
dmcnelis On

Windows doesn't store file names with case sensitivity. You'll need to either rename your files on the linux machine, or force all of your file references to lower case.

1
Reallyethical On

Linux file names are case sensitive unlike windows. So you must be explicit in what you call. Change the script to use the Pascal Case method you are showing above and it will function correctly.

Alternatively set a redirect in your web-server, to look for the Pascal Case version of the file.

What language are you using and what web server?