[pmwiki-users] Request input on soon-coming FAST Data release

Joachim Durchholz jo at durchholz.org
Thu Oct 5 08:27:26 CDT 2006


The Editor schrieb:
> 
> Well it does run fairly fast (zippy) still, but I was thinking fast in
> terms of quick to install and quick to get using.  Download.  Then cut
> and paste.  Instant functionality.  I'm thinking from an admin
> perspective.

Yes, but that applies to 90% of all recipes. It doesn't characterize 
what your recipe is doing.

On including just what's needed:
Split the recipe into several include files. If include file a.php needs 
definitions from include file b.php, have a.php do
   include_once ('b.php');
somewhere.
The above ignores subdirectory issues. I usually do something like
   include_once (dirname (__FILE__) . '/b.php');
to include a file that's stored in the same directory as a.php.

With multiple include files that use each other, I usually end up with a 
couple of common files that are included from most of the others, and 
"feature files" that look like this:
   <?php if (...) return; # check that pmwiki is running
   include_once (dirname (__FILE__) . '/common.php');
   function feature_1 (...) {...}
Administrators then include just those feature files that they need from 
config.php, which in turn then include all the base machinery required 
specifically for them.
Tend to keep the footprint of extensions low - *provided* that the 
administrator includes just those features that he really needs.

The nice thing about this approach is that nobody needs to copy code around.

Regards,
Jo




More information about the pmwiki-users mailing list