SVN change : defining EXT

The latest change is in the index.php file
define('EXT', '.php');
My first reaction was, if the constant value is a string why not move it to the constants.php file?

Bacause of line 115 in index.php?
The EXT value is used for all the other includes, so without it, you can't load codeigniter.php and therefore you can't get the constants.php file

True but if you are going to set the constant with a string isn't that a sign the constant isn't really needed? Who is going to change the extension of all the framework files?

why did the php file extention need to be defined in the first place :|

[eluser]Colin Williams[/eluser]
Quote:why did the php file extention need to be defined in the first place :|
There are plenty of reasons. Don't you think if someone had some sort of requirement where they wanted a different extension, they'd scream bloody murder that CI locked them in. It's an example of constantly asking, "What happens if..." while developing, which everyone should do. "What happens if the server should only parse .phtml extensions through the PHP parser?" "What happens if users want to force CI to run as PHP 5, but not legacy code elsewhere, so they use a .php5 extension." Etc.

Quote:True but if you are going to set the constant with a string isn’t that a sign the constant isn’t really needed?

Well, the string should never change, therefore it's a constant. There is also the subject of "developer experience" to take into consideration. For instance, sometimes you would rather have something like

than just 'key' == TRUE/FALSE. It may be more verbose but it reads better and is self-documenting.

Sure having the EXT constant gives you a single point of entry, but the change makes it static instead of dynamic. It seems a step back.

[eluser]Colin Williams[/eluser]
How is it made static? It's still in an application-level file. And the EXT constant has been there for a long time now. Maybe all the way back to the first release. It was just moved. Much ado about nothing.

the line was
define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
so with the change you have to change the extension yourself where the bootstrap file was used to extract the extension from.

Just because it is been that way for so long why did it go to a static string?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.