Revamping URL aliasing
The current system scales poorly Even with 4.7 enhancements, there is a lot more than can be achieved. And it's not really trivial to administer 100K+ aliases. How do we move to a mapping approach while retaining the current flexibility?
Callbacks should not rely on $_GET['q'], only on parameters handed to them. This creates much more reusable code which is a boon in itself.
As a second step we could make the url() and l() functions 'intelligent'. Instead of handing over a simple string, we hand over a type and an id. In most cases this is as simple as splitting at the first slash, but what about the urls that do not look like node/12345?
To continue the system, for each type, we have a function, choosen previously on an admin UI, which creates the path from the type and the id. Incoming URLs can simply be handed by the current menu system: every mapping system adds a menu entry, and from the parameters it finds out the relevant callback and calls it. For example, pathauto paths could look like http://example.com/pathauto/user/username.
To sum up, our tasks are
- make all callbacks clearly parameterized.
- Remove excess
arg()usage. - Decide on the exact mechanism on how we could make the
url()andl()functions 'intelligent'.
