[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Debian-sf-devel] Plugin infrastructure -- Request for comments

From: Tim Uckun
Subject: Re: [Debian-sf-devel] Plugin infrastructure -- Request for comments
Date: Fri, 15 Nov 2002 12:26:12 -0700

> You do run into the problem of plugins stepping on each other, then,
> though.

"  Not if the insertion points are integrated into the main code and
managed centrally.  I do not believe there will be hundreds of plugins
requiring manual intervention anyway, so it should be manageable
without too much hassle."

Here is what I have done in the past and it has always worked for me.

I have a code snippet (it has to be a global thing) which is run on every page. This function traverses the all the parent directories including any files whose names are In this way each directory becomes a small mini application. Anything in the is visible to all directories lower in the chain. I also have a which contains functions and values that are only used by other files in the same directory. This works very well for me as a method of encapsulating. If you use a fusebox type of approach then every directory has an index.php which includes (there is one in the include directory which contains my function) which then goes on to include all other up the directory hierarchy. Simple neat and you never have to worry about every page having a bunch of includes. Here is the snippet.


// Always include this file

$global_filename = $DOCUMENT_ROOT . '/';

if (is_file($global_filename)):
        include $global_filename;

while ($offset = strpos ($PHP_SELF, '/',$offset + 1)):
$global_filename =$DOCUMENT_ROOT . substr ($PHP_SELF, 0, $offset) . '/';
   if (is_file($global_filename)):
        include $global_filename;

This might be a part of the solution.

Tim Uckun
US Investigations Services/Due Diligence

reply via email to

[Prev in Thread] Current Thread [Next in Thread]