This is an example of how to embed PEAR_Frontend_Web in an existing website, so it can be used to manage modules.

This package succesfully embeds PFW in (a previous version of) Geeklog, and only required me to change 2 files: public_html/admin/pluginmanager.php and system/pear/pearfrontendweb.php

PREREQUISITES:
--------------
Your software, or at least your modules, must be packaged in pear packages and should be hosted on a channel server.
  The easiest way to make a 'module filter' work (such that PFW only shows your modules, and not any other packages) it to let them all depend on some kind of 'module master package'. The dependency on this package will be the filter criteria.

HOW TO DO IT:
-------------
You need one script to connect your website to PFW, and add filter code to some PFW files to make it work.
  To make it look good you will need to do some template fiddeling : )

=== connect script ===
In this example, this is public_html/admin/pluginmanager.php
  It does following things:
1) do authentication in the CMS (lines 39 - 51)
2) do necessary CMS output like the menu etc (lines 150 - 162)
3) initialise PFW variables (lines 164 - 170)
4) Create a new registry if it doesnt exist yet (lines 172 - 265)
  -> This is copy-paste code in which few things have to change
5) Set up the module filter (lines  276 - 293)
6) Launch PFW (lines 295 - 312)

=== pear_frontend_web.php adjustments ===
These are literally the only changes required:
1) filter packages (lines 222 - 224 and 231 - 235)
2) add install/upgrade/uninstall hooks (lines 252 - 262)

=== Frontend/Web.php adjustments ===
All changes are literally reusable
0) except setting the location of the datadir (lines 144-148 2096-2100)
1) implementation of the filter (lines 2404 - 2568)
2) calls to the filter (lines 342-345 531-534 654-657 708-728 874-877 980-983 1074-1077


That's it !

Most of this changes are reusable and can be integrated into mainline PFW is there interest.


Feel free to contact me if you're interested in using this:
tias@ulyssis.org


Tias,
2008-08-02
