Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 3.0 forced uppercase naming of controllers and classes
#9

Hey stefano, you're correct that PHP can tell what case the file system reports the file as. But the tricky part is going the other direction.

On case-insensitive file-systems, like Windows and Mac have, if PHP tries to open "FileA" but the file is actually named "filea" there won't be a problem and you'll never notice an issue. However, as soon that site is running on Linux it will throw and error because the file system there IS case-sensitive, and "filea" !== "FileA".

In CI 2.x, IIRC, it would first look for the file as it was asked to, whether that was "FileA", "fIlEa", "filea" or whatever, If it didn't find that version of the file, it would look again for the lowercase version. That's why your scenario worked fine in previous versions. Additionally, I believe certain file types were expected to have a different capitalization than others? Don't recall for sure, but seems to tickle my memory.

In CI3 it has standardized so that all of the files are ucfirst. This keeps things consistent among the files, and keeps it working between OSs without a hitch, while allowing the framework code to be simplified, and provide a tiny performance boost at the same time. So, if you weren't used to doing it all lower case (which I will admit, I used to like better, too), then there wouldn't be any surprises when moving from one OS to another.

I don't know the exact reasons it was originally chosen to change that, but that's my best guess and understanding.
Reply


Messages In This Thread
RE: Codeigniter 3.0 forced uppercase naming of controllers and classes - by kilishan - 05-18-2016, 02:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB