[development] Drupal 6.2 theme system standalone

Larry Garfield larry at garfieldtech.com
Sat Jun 14 05:14:39 UTC 2008

On Friday 13 June 2008, Bob Pepin wrote:
> I've put a somewhat more complete version that includes an API and a
> theme browser up on google code.
> http://drupal-theme-standalone.googlecode.com/
> btw, drupal isn't perfect either, just earlier I spent fifteen minutes
> hunting a bug just because I dared to create a variable called $theme
> in some toplevel code.. turned out that global was already taken by
> the drupal theme system, which apparently doesn't bother too much with
> error checking, so all I got was a blank page, no error message, no
> nothing.. of course PHP isn't completely innocent in this either ;)

Creating a global variable in the first place was your first mistake.  They 
are a design flaw by definition for exactly the reason you describe.  
Creating one that was not namespaced to your module was mistake #2, for the 
reasons you describe. :-)

You cannot really error check globals in that way, which is part of the 
problem with them.

Friends don't let friends use globals. :-)

Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 

More information about the development mailing list