Class Nexista_Foundry

Description

This class is reponsible for building a site/application based on desired sitemap and configuration settings.

The build process creates a compiled php file from the sitemap definition as well as the necessary file to handle the logic of presenting these files based on request.

A typical build would output:

  • A loader file such as index.php which is used as the 'entrance' file for the application.
  • A switchbox file which is responsible for returning the proper data based on request
  • A number of 'gate' php files, one for each section or 'page' of the sitema which
are responsible for handling the per request logic and will load the necessary module files such as query definitions, php scripts, xsl stylesheets,
  • A configuration file based on our preferences.
To build an application, you will need a script to call the Foundry process. Here is some sample code:
  1.  <?php
  2.  //load the application builder class
  3.  require_once('/home/lotus/nexista/kernel/foundry.php');
  4.  
  5.  //instanciate and initialize it with our desired registry file
  6.  $foundry Foundry::singleton();
  7.  
  8.  //load the master config, the user override config and process for 'live' mode
  9.  $foundry->configure('./master.xml','./user.xml''live');
  10.  
  11.  //build loader (i.e. index.php)
  12.  $foundry->buildLoader();
  13.  //compile the application
  14.  $foundry->buildGates();
  15.  $foundry->buildSitemap();
  16.  ?>

Located in /kernel/foundry.php (line 70)


	
			
Variable Summary
 boolean $debug
Method Summary
 static string singleton ()
 void buildGates ()
 boolean buildLoader ()
 void buildSitemap ()
 void configure (string $master, [string $local = null], [string $mode = null], [ $config_filename = 'config.xml'])
 string getCompilePath ()
 string getSitemapPath ()
Variables
boolean $debug = false (line 114)

Print debug info when building

  • access: public
object $sitemapDocument (line 88)

Sitemap root node object

  • access: public
Methods
static singleton (line 749)

Returns gate prepend code

  • return: prepend code
  • access: public
string singleton ()
buildGates (line 322)

Parses the sitemap, calling build process for each gate

  • access: public
void buildGates ()
buildLoader (line 195)

Builds the loader file (i.e. index.php)

This method creates a loader file based on config settings. This file is used as the 'entrance' file for the site, loading the sitemap and appropriate gate file.

  • return: success of writing loader file
  • access: public
boolean buildLoader ()
buildSitemap (line 439)

Compiles the final sitemap file

This method takes $this->sitemap array which contains all the gate info and builds an if/else condition map out of it. This file will be used as the sitemap for the site

  • access: public
void buildSitemap ()
configure (line 132)

Read and writes the application config data

This method loads the config data that holds the applciation parameters such as paths, location of sitemap, session preferences, db connections, etc... Some of this data will be written directly in the gate files during the compile process. It takes the config xml and ouputs it as combnined xml file for runtime.

  • access: public
void configure (string $master, [string $local = null], [string $mode = null], [ $config_filename = 'config.xml'])
  • string $master: master config file
  • string $local: optional local override configuration file
  • string $mode: optional environment profile
  • $config_filename
getCompilePath (line 179)

Returns the path to the compile directory

  • return: path to sitemap
  • access: public
string getCompilePath ()
getSitemapPath (line 166)

Returns the path to the sitemap Useful for checking the mod time for required rebuilds

  • return: path to sitemap
  • access: public
string getSitemapPath ()

Documentation generated on Tue, 11 Mar 2008 23:23:03 -0400 for Nexista 0.2.0