[geeklog-devel] lib-layout.php

Joe Mucchiello joe at ThrowingDice.com
Fri Jan 4 00:22:30 EST 2008

At 11:52 PM 1/3/2008, Blaine Lang wrote:
>Is this a new feature or a change (not sure)

I'd like to see a lot of internal functions made extendable. Anything 
that would reduce the necessity for patches would be great.

If I can go way out there, how about a function database table. 
gl_function (function_id, override_name, override_owner)?

There'd be a global array: $_FUNCTIONS = array($function_id => 
$override_name, ....) which would be loaded in lib-common.php. Then 
all the overridable functions would start:

function COM_whatever(...)
     global $_FUNCTIONS;
     if (array_key_exists($_FUNCTIONS['whatever']) && 
is_callable($_FUNCTIONS['whatever'])) {
         return call_user_func_array($_FUNCTIONS['whatever'], func_get_args());
     // rest of function

In theory the only overhead is the call to array_key_exists() when 
the function has not be overridden. This would be a lot simpler than 
the CUSTOM_ stuff all over the code.

>Is it worth doing as part of 1.5 - thats the ?

No. Add the template caching library which is working, debugged and 
has no real downsides before **__STARTING__** an overhaul of 
COM_siteHeader/Footer. Geez, I just notice the title was 
lib-layout.php. Heck, why not call it layout.class.php and do it right?

Joe Mucchiello
Throwing Dice Games

More information about the geeklog-devel mailing list