Are case-sensitive file names really needed? |
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?
Well... by not capitalizing the file names you are actually relying on a "bug" of Windows operating system
So why not capitalizing the file names if that is what the manual says? Website: http://avenir.ro
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.
(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. You can skip filename errors usin third party software instead. I suggest to try Long Path Tool. (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. 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. |
Welcome Guest, Not a member yet? Register Sign In |