Codeigniter 3.0 forced uppercase naming of controllers and classes |
Question:
If the default ENVIRONMENT constant was temporarily set to "development" would incorrectly named files show? PHP Code: // define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); Fortunately I use Linux so don't have this problem
(05-18-2016, 02:41 PM)kilishan Wrote: 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. Hi Kilishan, thank you for the explanation. I still cannot understand the difference between the test I made and the "other direction", I'm sure it's something I'm missing. Do you maybe have a pointer to the source code where Codeigniter looks for the file in the capitalised version? Another question: why couldn't CI let the route.php file decide if the controller has to be lowercase or ucfirst or whatever... for example, in my route.php file I have: $route['default_controller'] = 'website'; //lowercase and not: $route['default_controller'] = 'Website'; // Ucfirst But CI 3.0 does not complain and go searching for a "Website.php" file. Why couldn't CI simply follow the naming used by the programmer and open the corresponding file?! S.
(05-18-2016, 03:20 PM)ivantcholakov Wrote: @stefano.corsi Hi @ivantcholakov thank you for your reply. I also feel uncomfortable in changing case of filenames in production stuff. Could you please provide a link to your application starters? Thank you Stefano
(05-18-2016, 03:20 PM)ivantcholakov Wrote: There is a way, but it is not easy. I would recommend you to have a look at my application starters that I've published at GitHub, they support both the new and the old file/class naming conventions. At some moment in the future (when I migrate all my previous works) I intend to drop this BC feature for making code cleaner and faster. Found it! Thanks. https://github.com/ivantcholakov/starter...edition-4/ (05-20-2016, 03:07 AM)stefano.corsi Wrote: Another question: why couldn't CI let the route.php file decide if the controller has to be lowercase or ucfirst or whatever... for example, in my route.php file I have: Because for every programmer that wants this, there are a 100 that would complain CI doesn't automate this. |
Welcome Guest, Not a member yet? Register Sign In |