On Wed, 13 Mar 2013 11:40:08 -0700, <vitalif(a)yourcmc.ru> wrote:
I doubt Daniel
would have introduced it if it was "un-necessary" or
"pointless", I believe from memory it was to improve the handling of
paths over a wide range of set-ups and environments (where sometimes
it would fail). You would need to git blame the file and find the
revision where it was introduced to confirm if that is truly the case
(or if i'm mistaking it for other code)
I've looked at the annotations and what I've seen is that PathRouter
only fixes
https://bugzilla.wikimedia.org/show_bug.cgi?id=32621 by using
path weights. Actually, I've started looking at the routing code after
hitting this same bug with img_auth.php action path. But as I
understand, it could be fixed much simpler just by reordering two parts
of existing code and examining $wgArticlePath after $wgActionPaths :)
And a single extension using the PathRouter is
http://www.mediawiki.org/wiki/Extension:NamespacePaths ...
Of course I support new features, there are some features that I myself
would want to be in MW core :-)
And I'm sure my point of view may be incorrect :-) but MW trunk (i.e.
master) slightly frigtens me when compared to previous versions - the
codebase seems to grow and grow and grow having more and more and more
different helpers... And it becomes more and more complex with no
simplification effort... (or maybe I'm just not aware of it)
fixing bug 32621 is a todo. The first attempt failed and some tweaks are
needed to use the PathRouter to fix that bug.
PathRouter allows for the use of custom paths to expand. NamespacePaths is
an example of one thing you can do (say giving Help: pages a /help/ path)
but you could also apply that to special pages, etc... whatever. It's also
the precursor to MW being able to handle 404s natively. The plan is in the
future you'll just be able to throw everything that's not a file right at
index.php and pretty urls, 404 pages, 404 thumbnail handlers, etc... will
all just work natively without any special configuration.
And by 404, I don't mean standard 404 pages like this:
http://wiki.commonjs.org/404
I mean nice in-site 404 pages that actually help visitors find what they
were looking for:
http://www.dragonballencyclopedia.com/404
Not sure how PATH_INFO being unmangled fixes anything. There are other
servers where PATH_INFO won't easily be outputted. REQUEST_URI handling
works better in every case. And ?title=$1 in rewrite rules are evil.
Determining what urls run what code has always been the job of the
application in every good language, not the webserver. And we can do it
using REQUEST_URI much more reliably than some webservers.
Anyways, I wish I could just get rid of the PATH_INFO code. I have yet to
hear of someone actually using it now that practically every webserver
there is outputs REQUEST_URI meaning the PATH_INFO code is never reached.
--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [
http://danielfriesen.name/]