On Sun, Jun 15, 2008 at 6:48 AM, Markus Krötzsch mak@aifb.uni-karlsruhe.de wrote:
On Samstag, 14. Juni 2008, Tim Starling wrote:
Using .inc as a file extension for included PHP files would fix the problem more effectively than either autoloading or guarding.
Well, this would be easy enough to do, but I see MediaWiki is not using that option either. Have there been any problems with that practice? Does it work fine on all sites?
.inc doesn't tell you it's a PHP file. This causes some editors' syntax highlighting to become confused. If you use a PHP IDE, the only way to get it to reliably load the file on double-click is to have it load *all* .inc files, which may include some non-PHP files. Also, renaming to .inc would probably mean that the files would be served as text or HTML files when directly requested, which might cause unanticipated issues (certainly for configuration files!). Using .php but having the sole contents be class/function/variable/etc. declarations returns a blank page.
Overall, this solution is unnecessarily inconvenient, when autoloading works perfectly well.