Re: [metabase-dev] smarty
| From: | Manuel Lemos | Date: | Mon, 18 Mar 2002 10:18:51 +0000 |
| Subject: | Re: [metabase-dev] smarty | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5015@lists.php.net to get a copy of this message | ||
Hello Lukas,
Sorry for the delay, I have a backlog of messages from you to reply that
I did not do before because I am working really hard to bring up tens of
mirrors world wide for the PHP Classes. I will answer to all pending
messages as soon as I have some time free.
Lukas Smith wrote:
>
> Hi,
>
> do you know anything about the internals of smarty?
No, but it does not need to look into it to figure how to make a plugin
architecture with PHP. MetaL compiler is all plugable. Despite it loads
all the classes it needs before compiling anything, there is no reason
to not make Metabase load only the necessary classes on demand.
> After briefly taking a look, it seems to me their on demand works
> because they only have one function per plugin ...
>
> But I guess we could also just maintain an array of all functions that
> are in each plugin and then do a require_once when the function is
> needed ...
If we know all functions that we need, there is no reason to keep them
in an array.
> Actually I have no good idea to do this at all ... Manuel what was your
> idea again?
Very simple: if a driver knows specifieds that it supports a feature
that is made available as an extension, it should store in some class
variable the class file name thatr should be loaded at setup time. The
drivers base class should always implements the extension functions.
When those functions are called, it should defer to the extension
object.
> I guess what Stig is offering is aggregate .. but that will only work
> for very recent versions of php ...
I have yet to see the documentation of that function, but I think that
as long as we choose a convinient function naming scheme, we should be
able to use aggregate conditionally if it exists
if(function_exists("aggregate")) .
Regards,
Manuel Lemos