PHP Common Repository

Contains all common code that should be used by nearly all (of 'our') PHP projects. e.g. Libraries, standard ways of doing stuff, things to save you time etc etc.

The contents of this web site are available under the following license - source:trunk/lib/LICENSE.txt ; note this repository is formed from an amalgamation of other projects (smarty, propel, pear etc) so the LICENSE.txt file _only_ applies to code that is not covered by other project's license(s). The repository contains a handful of patches to Smarty and Propel to make them behave in a way we expect. This may not work for everyone.

Finally, this is an ongoing work. In the event that you use any files contained here, we'd love feedback (patches, criticism etc). For such things email david @ $thisdomain

Final note: This is in a state of flux, will probably move to Propel 1.3.0 when it's released, and may start to use the ZendFramework? (instead of our rather crude dispatch.php). Some of the code is a bit messy (especially the PPFormHandler.php stuff).

Testing related

DataManager

Code auto-generation

User facing code :

build_structure - Create simple add/edit, browse, view pages

build_form

(See also [BuildForm])

To do

  1. Change lib/init.php to something like PPInit(), allowing for optional use of Smarty, Propel etc.
        $env = new PPInit(....);
        $env->usePropel();
        $env->setup();
        $smarty = $env->getSmarty();
        $log = $env->getLogger(); /* necessary? */
    
        /* now include_path and autoload are all setup ? */
    
    
  2. Change lib/init.php to do lazy initialisation of Propel - i.e. only do it if we do a lookup for a *Peer or whatever class
  3. Change public/dispatch.php to use e.g. the Zend Framework's dispatch system
  4. Change the controller classes to look more like ZF controller objects.
  1. Change public/dispatch.php mechanism so that there can be 'common' controllers held somewhere in lib (e.g. javascript_loader.php) - so it should hunt in public/*, app/controller/* and then lib/something/* - done.
  1. Security + menu stuff - needs integrating (remove PPAuthentication::requireRole() from individual scripts)
  2. Foreign language support (there is a internationalised Smarty...)
  3. Propel helpers - are these a symfony only addition? (see [here  http://trac.symfony-project.com/trac/wiki/SymfonyPlugins#Propelextensions] )
  4. Reusable authentication page(s) (e.g  http://server/project/admin/user-admin ?) where you can define groups, users, and who can access what.

Other Stuff

 http://propel.jondh.me.uk/ - Generate Criteria / PHP code from an SQL statement.

 http://wiki.moobert.co.uk/phpcommon - another guide to using this stuff.