Welcome Guest, Not a member yet? Register   Sign In
Are case-sensitive file names really needed?
#1

I have recently upgraded from CI2 to CI3 and one of the stesp says to have capitalised file names for Controllers and Models.

However, during the upgrade, I noticed that CI3 worked without the capitalisation.

What is the reasoning behind having capitalised file names (seeing as CI2 didn't have them) and assuming I am not using a Linux based server environment, is it safe to not use capitalised file names?
Reply
#2

Well... by not capitalizing the file names you are actually relying on a "bug" of Windows operating system Wink

So why not capitalizing the file names if that is what the manual says?
Reply
#3

It's just a change in naming convention. It's quite common to use the exact same name of the class as the filename plus the '.php' extention.

It allows you to make better use of tools (editors and Code Sniffer etc) and make it easier for other people to find the correct file if they need to edit in order to make a small modification to some model.

I think you have answered your own question, is it save to leave the filenames as is? As long as you are sure your application will never ever need to run in another environment it won't break. But is it best practice? No it's not. If someone takes over the project in a later stage and runs into this you will get blamed for not doing a good job (not following upgrade guide) even though the app still worked after you upgraded.
Reply
#4

(01-04-2016, 02:40 AM)mr_pablo Wrote: I have recently upgraded from CI2 to CI3 and one of the stesp says to have capitalised file names for Controllers and Models.

However, during the upgrade, I noticed that CI3 worked without the capitalisation.

What is the reasoning behind having capitalised file names (seeing as CI2 didn't have them) and assuming I am not using a Linux based server environment, is it safe to not use capitalised file names?

You can skip filename errors usin third party software instead. I suggest to try Long Path Tool.
Reply
#5

(01-04-2016, 02:40 AM)mr_pablo Wrote: I have recently upgraded from CI2 to CI3 and one of the stesp says to have capitalised file names for Controllers and Models.

However, during the upgrade, I noticed that CI3 worked without the capitalisation.

What is the reasoning behind having capitalised file names (seeing as CI2 didn't have them) and assuming I am not using a Linux based server environment, is it safe to not use capitalised file names?

Best practice would be to follow the capitalization rules. You never know what the future might hold. It's always possible that somewhere down the line the site owner might decide to switch servers. Plus, it's a good habit to be in for all of the other sites you might create.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB