News for hackers. Stuff that matters.
Re:Kill your index.php by secstate on Tuesday January 28, 2014 @09:40PM (#7141486)
I'm pretty sure Rails, et al, use a single point of contact because that's kinda what web servers do.

I actually shivered a little bit thinking about an app where each url was in a new file somewhere. I mean, ack is only going to take you so far when you're trying to find out where something was implemented.

And that's to say nothing of URL passing between different URL paths.

Honestly, Django doesn't have an index.py file anywhere. Rather it has a urls.py and apart from some really gnarly projects, if you wanna know where something is implemented, you open the root urls.py file and follow the chain down to the app where your URL is being generated. That points you at a view and usually the form or model that's causing issues.

Re:Kill your index.php by astrodust on Tuesday January 28, 2014 @09:54PM (#7141529)
Rails, NodeJS, Django, they all do it with one entry point. That gives you maximum flexibility to decide what to do with a request once you've received it rather than already being locked into some particular approach based on path.

This is done in the "Routing" layer which also helps provide diagnostics when it comes to seeing which bit of code was engaged.

There's a term for what an app with hundreds if not thousands of loosely defined entry points is called: A mess.

Re:Kill your index.php by ldite on Wednesday January 29, 2014 @04:39AM (#7142935)
Well, to be pedantic, most Django projects have a WSGI file, which is the single entry point of the application.

(The WSGI file is part of your application code, but it typically just calls django.core.wsgi.get_wsgi_application(), which returns an instance of django.core.handlers.wsgi.WSGIHandler, which is the entry point into the Django routing/despatch framework)

Re:Kill your index.php by dools on Tuesday January 28, 2014 @09:59PM (#7141550)
I actually shivered a little bit thinking about an app where each url was in a new file somewhere. I mean, ack is only going to take you so far when you're trying to find out where something was implemented.

That's essentially what controllers are. How a URL gets mapped to a controller is somewhat moot, in reality most "pages" equate to either a file or a class somewhere.

I'm not advocating that one shouldn't have a single entry point. I'm advocating that it shouldn't be part of a centralised framework.

Re:Kill your index.php by oinksoft on Wednesday January 29, 2014 @01:16AM (#7142268)
As Rasmus Lerdorf and folks like Terry Chay have been saying forever, PHP is the framework.
Re:Kill your index.php by cookrn on Tuesday January 28, 2014 @10:12PM (#7141593)
Like this? http://aspen.io/
Re:Kill your index.php by clone1018 on Tuesday January 28, 2014 @10:19PM (#7141623)
Aspen makes it a feature :). The code can still be organized, you can still have models and shared code. I think (although I don't use it in production) that it's quite refreshing.