Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

BaseJumper Class Reference
[BaseJumper Framework]

List of all members.

Detailed Description

BaseJumper is the controller for your whole site.

It handles module loading, initialization, template stuff, and much more.

Definition at line 14 of file basejumper.inc.php.

Public Member Functions

 __construct ($defaultTemplate= 'DefaultTemplate', $defaultClass= 'Main')
 here is our constructor.
 addModule ($module)
 this function adds a module to the list of modules that BaseJumper will serve up.
 addModules ($modules)
 this function will add a whole bunch of modules in at the same time.
 removeModule ($module)
 this function removes a module from the list of modules that BaseJumper will serve, effectively disabling it.
 hasModule ($module)
 this function tells us if we have a module loaded or not.
 start ()
 this is the main hook of the library.
 setModule (BaseModule $module)
 this sets our module for the page we're drawing.
 getCreateHitTrackingTable ()
 this function gets the create syntax for the module usage tracking table.
 trackPageHit ($module=null, $page=null)
 this will track a hit to a certain page in a certain module in the database
 clearHits ()
 remove all the hit tracking records from the db.
 getModulesArray ()
 this returns a sorted array of all the module names this BaseJumper knows how to handle
 getModulesXml ()
 this function gets the xml string describing all the modules in our system.

Static Public Member Functions

 getDbTables ()
 get an array of all the tables in our database...
 getDbTable ($table)
 get an array of data about our table...
 getTableIndexes ($table)
 get an array of index information about our table.
 dbHasTable ($table)
 tells us if we have a table in the database or not.
 tableHasField ($table, $field)
 tells us if a table in the database has a field or not.
 autoload ($class)
 This function tries to autoload our class files!!

Public Attributes

 $defaultClass
 The name of our default class.
 $defaultTemplate
 The name of our default template.
 $object
 Our instance of the module object.

Static Public Attributes

 $tables = null
 our database tables - overview array
 $tableData = array()
 our list of data for each table.
 $tableCacheLife = 3000000
 how long do we cache our table structure data for? (in seconds)
 $trackHits = true
 do we track hits to the site on module / page basis?
 $hitTrackingTable = 'site_hits'
 table to track hits to the site on.

Protected Member Functions

 checkCredentials ()
 this function sets up and initializes our global user.
 checkHost ()
 this function checks to make sure we're on the right host and redirects us if we're not.
 filterFinalOutput ($output)
 this function adds in stuff liek runtime, queries, etc to the body.
 init ()
 This function initializes everything.
 getPage ()
 check our parameters and figure out what our page is.
 getParams ()
 check our request vars to get our parameters.
 getGlobalTemplate ($params)
 this function will check our request to see if they want a special template.
 checkAuthCode ($params)
 this fucntion checks to see if an authorization code was passed in.
 loadModule ($module=null)
 This function loads the object.

Static Private Member Functions

 lookupDbTables ()
 this function looks up all of the tables contained in the database and stores them in our static variable.
 lookupDbTable ($table)
 this function looks up detailed information about a table in our database and stores it on our static array.

Private Attributes

 $modules = array()
 this is our list of module names in string form.


Member Function Documentation

BaseJumper::__construct defaultTemplate = 'DefaultTemplate',
defaultClass = 'Main'
 

here is our constructor.

you provide the default class and default template, it handles the rest.

Parameters:
$defaultClass the string name of the default class if none are supplied. Defaults to 'Main'
$defaultTemplate the string name of the default template to use. Defaults to 'Template'

Definition at line 67 of file basejumper.inc.php.

References Config::get().

BaseJumper::addModule module  ) 
 

this function adds a module to the list of modules that BaseJumper will serve up.

Parameters:
$module the string name of the module to add

Definition at line 84 of file basejumper.inc.php.

BaseJumper::addModules modules  ) 
 

this function will add a whole bunch of modules in at the same time.

Parameters:
$modules and array of string module names

Definition at line 98 of file basejumper.inc.php.

BaseJumper::autoload class  )  [static]
 

This function tries to autoload our class files!!

Parameters:
$class the name of the class to autoload
Returns:
true on success false on failure

Definition at line 595 of file basejumper.inc.php.

BaseJumper::checkAuthCode params  )  [protected]
 

this fucntion checks to see if an authorization code was passed in.

if it does, it attempts to use it to authenticate our user. if it fails, ti will trigger an error. on success, it jsut logs the user in.

Parameters:
$params an array of parameters to check

Definition at line 536 of file basejumper.inc.php.

BaseJumper::checkCredentials  )  [protected]
 

this function sets up and initializes our global user.

Definition at line 281 of file basejumper.inc.php.

BaseJumper::checkHost  )  [protected]
 

this function checks to make sure we're on the right host and redirects us if we're not.

Definition at line 293 of file basejumper.inc.php.

References Config::get(), and Util::redirect().

BaseJumper::clearHits  ) 
 

remove all the hit tracking records from the db.

Definition at line 673 of file basejumper.inc.php.

References dbExecute().

BaseJumper::dbHasTable table  )  [static]
 

tells us if we have a table in the database or not.

Parameters:
the string name of a table.
Returns:
bool if it exists or not.

Definition at line 188 of file basejumper.inc.php.

Referenced by BaseObject::checkTable().

BaseJumper::filterFinalOutput output  )  [protected]
 

this function adds in stuff liek runtime, queries, etc to the body.

%BJ_RUNTIME%% gets replaces with the time in seconds, &&BJ_CACHE_HITS%% gets replaced with the number of cache hits, and %BJ_QUERIES%% gets replaces with the number of db queries used.

Parameters:
$output the whole site output to use
Returns:
the data to display to the user =)

Definition at line 372 of file basejumper.inc.php.

BaseJumper::getCreateHitTrackingTable  ) 
 

this function gets the create syntax for the module usage tracking table.

this will track all the hits your site is getting by module and page in that module.

Returns:
mysql create string

Definition at line 630 of file basejumper.inc.php.

BaseJumper::getDbTable table  )  [static]
 

get an array of data about our table...

basically the result form DESCRIBE $table

Parameters:
$table teh name of the table we want info on.
Returns:
the array of info on that table.

Definition at line 151 of file basejumper.inc.php.

Referenced by BaseObject::getDbFields().

BaseJumper::getDbTables  )  [static]
 

get an array of all the tables in our database...

used for autodetection stuff

Definition at line 137 of file basejumper.inc.php.

BaseJumper::getGlobalTemplate params  )  [protected]
 

this function will check our request to see if they want a special template.

if so, then return that, otherwise give us a default template. the 'template' variable is checked and if found it will be used and then unset.

Returns:
a BaseTemplate derived object.

Definition at line 513 of file basejumper.inc.php.

BaseJumper::getModulesArray  ) 
 

this returns a sorted array of all the module names this BaseJumper knows how to handle

Returns:
an array of the module names (in string format)

Definition at line 683 of file basejumper.inc.php.

BaseJumper::getModulesXml  ) 
 

this function gets the xml string describing all the modules in our system.

Returns:
an xml string with each module data as generated by each module.

Definition at line 696 of file basejumper.inc.php.

BaseJumper::getPage  )  [protected]
 

check our parameters and figure out what our page is.

Returns:
the string name of our page to draw.

Definition at line 463 of file basejumper.inc.php.

BaseJumper::getParams  )  [protected]
 

check our request vars to get our parameters.

this is unvalidated, just the raw request.

Returns:
the array of key to value for parameters

Definition at line 477 of file basejumper.inc.php.

References Config::get().

BaseJumper::getTableIndexes table  )  [static]
 

get an array of index information about our table.

based on SHOW INDEXES

Parameters:
$table the name of the table we want info on.
Returns:
the array of index info on that table.

Definition at line 165 of file basejumper.inc.php.

References dbFetchAssoc(), and dbQuery().

BaseJumper::hasModule module  ) 
 

this function tells us if we have a module loaded or not.

Parameters:
$module the string name of the module to check

Definition at line 127 of file basejumper.inc.php.

BaseJumper::init  )  [protected]
 

This function initializes everything.

It creates the object that does the actual drawing and initializes it.

Returns:
true on success, false on failure

Definition at line 395 of file basejumper.inc.php.

BaseJumper::loadModule module = null  )  [protected]
 

This function loads the object.

It supports auto loading of modules so you dont have to include them off the bat.

Parameters:
$module - if given, will attempt to load this module.
Returns:
teh module object on success, false on failure

Definition at line 559 of file basejumper.inc.php.

BaseJumper::lookupDbTable table  )  [static, private]
 

this function looks up detailed information about a table in our database and stores it on our static array.

Definition at line 243 of file basejumper.inc.php.

References dbFetchAssoc(), dbQuery(), CacheBot::get(), and CacheBot::set().

BaseJumper::lookupDbTables  )  [static, private]
 

this function looks up all of the tables contained in the database and stores them in our static variable.

Definition at line 214 of file basejumper.inc.php.

References dbFetchArray(), dbQuery(), CacheBot::get(), and CacheBot::set().

BaseJumper::removeModule module  ) 
 

this function removes a module from the list of modules that BaseJumper will serve, effectively disabling it.

Parameters:
$module the string name of the module to remove

Definition at line 109 of file basejumper.inc.php.

BaseJumper::setModule BaseModule module  ) 
 

this sets our module for the page we're drawing.

it loads the default template and such.

Parameters:
$module a BaseModule derived object.

Definition at line 449 of file basejumper.inc.php.

BaseJumper::start  ) 
 

this is the main hook of the library.

it tells the object to draw itself. hefty work indeed.

Definition at line 304 of file basejumper.inc.php.

References Config::get(), BaseModule::getCachedPage(), ErrorHandler::handleException(), and BaseModule::setCachedPage().

BaseJumper::tableHasField table,
field
[static]
 

tells us if a table in the database has a field or not.

Parameters:
table the string name of a table.
field the string name of the field.
Returns:
bool if it exists or not.

Definition at line 203 of file basejumper.inc.php.

Referenced by BaseObject::hasField().

BaseJumper::trackPageHit module = null,
page = null
 

this will track a hit to a certain page in a certain module in the database

Parameters:
$module the text name of the module.
$module the text name of the page in the module.

Definition at line 649 of file basejumper.inc.php.

References dbEscape(), and dbExecute().


Member Data Documentation

BaseJumper::$defaultClass
 

The name of our default class.

Definition at line 19 of file basejumper.inc.php.

BaseJumper::$defaultTemplate
 

The name of our default template.

Definition at line 24 of file basejumper.inc.php.

BaseJumper::$hitTrackingTable = 'site_hits' [static]
 

table to track hits to the site on.

Definition at line 54 of file basejumper.inc.php.

BaseJumper::$modules = array() [private]
 

this is our list of module names in string form.

Definition at line 59 of file basejumper.inc.php.

BaseJumper::$object
 

Our instance of the module object.

Definition at line 29 of file basejumper.inc.php.

BaseJumper::$tableCacheLife = 3000000 [static]
 

how long do we cache our table structure data for? (in seconds)

Definition at line 44 of file basejumper.inc.php.

BaseJumper::$tableData = array() [static]
 

our list of data for each table.

Definition at line 39 of file basejumper.inc.php.

BaseJumper::$tables = null [static]
 

our database tables - overview array

Definition at line 34 of file basejumper.inc.php.

BaseJumper::$trackHits = true [static]
 

do we track hits to the site on module / page basis?

Definition at line 49 of file basejumper.inc.php.


The documentation for this class was generated from the following file:
Generated on Fri Oct 27 12:26:41 2006 for BaseJumper by doxygen 1.3.9.1