[wp-trac] [WordPress Trac] #12935: Evolve the URL routing system
WordPress Trac
wp-trac at lists.automattic.com
Wed Feb 23 12:56:42 UTC 2011
#12935: Evolve the URL routing system
--------------------------+-----------------------------
Reporter: mikeschinkel | Owner: ryan
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Permalinks | Version: 3.0
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------------
Comment (by mikeschinkel):
Replying to [comment:60 scribu]:
> But the perceived lack of flexibility of WP_Rewrite isn't due to
regexes, but due to the way these patterns are generated and stored.
You misquote me. It's not a lack of flexibility of regular expressions;
it's the requirement to match each URL in it's entirety that makes it very
difficult for most people to set URL routes for anything beyond trivial.
Remember the old saw:
''"I had a programming problem and decided to use regular expressions.
Then I had two problems."''
> So, although there certainly are use cases for parsing individual path
segments - this can already be done
([http://wordpress.stackexchange.com/questions/9419/remove-taxonomy-slug-
from-a-custom-hierarchical-taxonomy-permalink/9685#9685 one example]) - it
shouldn't be the main way of defining rewrite paths.
>
> We should focus instead on making it easier to manipulate the existing
regex rules.
Can you please explain the logic behind your conclusion and why it makes
sense to continue to flatten a tree structure for matching? Also please
address the subsequent duplication required to match similar leaf nodes
(like permastructs) rather than to match a tree structure using a tree
structure, as proposed?
Also, can you help me understand why you'd advocate maintaining a system
that generates and map upwards of 1000 regular expresssions for a complex
CMS when with a tree structure the matching would be 1 to 2 orders of
magnitude less per page load?
And please address why retaining the complexity of the regular expressions
as used in the rewrite system makes sense vs. much more straightforward
simple match rules that mere mortals are much more likely to understand
(with fallback to RegEx, of course?)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12935#comment:62>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list