[wp-hackers] $single

Matt Mullenweg m at mullenweg.com
Wed Jun 16 05:56:31 UTC 2004


Alex King wrote:

> I'd rather have one 'page_type' variable than a bunch of binary variables.

The problem with this is it can be multiple things simultaneously. If you 
could only be on one page type at a time, then that would make sense. 
Don't forget we're heading toward URIs that allow:

http://example.com/category/music/2004/06/

The main advantage to having to having a unified set of $on_* variables is 
that otherwise people would have to check for $m and how long it is, and 
monthnum, and every possible variation of the query string that we support.

> On a related note (and as I've mentioned previously on the other list), 
> I'd like to see us develop a $wp or $page object that stores the WP 
> context. There are a number of benefits to this approach, some of the 
> big ones:
> 
> - Only one var to declare as global
> - less risk of accidental naming collisions for people wanting to hack 
> or integrate WP into an existing site
> - an object is somewhat self-documenting as all the vars are declared in 
> the class definition and can easily have a short description attached

So we'd be bringing one fat object into scope instead of a few much 
smaller variables? There are several advantages more objection orientation 
in places would bring in WordPress, however I don't think these are it. 
We'd do best to wait until we take a more ambitious architecture 
undertaking in a later version when our baseline PHP is more mature with 
regards to OO. However if you'd like to a UML class outline of what you 
had in mind for this endeavour, it's never to early to begin discussion.

(I'm waist deep in OO Perl at my day gig. I think it's affecting my sanity.)

-- 
Matt Mullenweg
  http://photomatt.net | http://wordpress.org
http://pingomatic.com | more soon...




More information about the hackers mailing list