brunoais wrote:Personally, I don't like to pass though an index.php to go somewhere. I prefer simply just go to the file and the file gets what it needs. Check viewtopic, viewforum, etc... Generic for their kind of thing but not as generic as index.
I personally like going through index because it keeps the root directory sort of clean. Instead of having a ton of new files added by extensions in the front directory, simply make index.php?ext=X access the index.php file in the ./ext/X/ directory. That way also it is easier to keep the extension files all together. The idea of extensions are to be able to simply upload a folder and run an install, rather than having to make sure all of the files are in the right place.
All of the rest of the extension's files are located in subdirectories of ext/X (where X is the extension folder) that correspond to the locations they would be in if they were in the core. (For instance, language files are in ext/X/language/y/z.php, and if it was in core it would be language/y/z.php). It only makes sense to put the front-facing file in the extension's directory. We can standardize it to require the front-facing file to be called "index.php" so that there isn't any confusion.
brunoais wrote:That one's better. If we have a gallery extension we can have the gallery.php in the root (of the forum) and then, that file, gets all the information it needs from there.
Putting the gallery.php page in the extension directory, is imo better than having it in the root directory. For one, it keeps the extension's files together.
Also, routing through index.php makes it easier to restrict access if the extension is disabled. If you try to access it through index.php, it can simply show the board index (also the behavior if an extension does not exist), but if you tried to access it through a root gallery.php file, you'd have to do the check to see if it is disabled in that file and then decide what to do (show an error or redirect, etc.). And if an extension is removed and someone tried to access gallery.php, they would get a 404 instead of gracefully ignoring the extension request.
brunoais wrote:I don't believe we would get name clashes. There may be two (or more) gallery mods but I don't belive one would want more than 1. I believe the admin of that forum would choose only one from all the one's available.
Well, maybe "gallery" isn't a good example for naming clashes, but there could be similar ext's that actually do different things but are named the same. We could perhaps keep this from happening by requiring all extensions to have a unique name in the customization database, though.