Installation
10/16/2009
Copy the entire BrickOO package in a new folder.
You might choose location for BrickOO which is accessible for multiple other software.
So many softwares could use one installed BrickOO.

To embed the BrickOO framework into your application, just include 'initialize.php' from the BrickOO package.


<?php
    
// Include BrickOO.
    
require_once ('../path2yourbrickoo/initialize.php' );

    
// set the temporary folders to use for cache, log and map files
    // recomend to set a path outside of the document root for security reasons
    // this three folders need write access !
    
BRICKOO::SetCacheFilesPath(realpath(dirname(__FILE__)) . '/temp/cache/');
    
BRICKOO::SetLogFilesPath(realpath(dirname(__FILE__)) . '/temp/logs/');
    
BRICKOO::SetMapFilesPath(realpath(dirname(__FILE__)) . '/temp/maps/');

    
// set the base application path
    // set the folders under the application path containing classes for autoloading
    
BRICKOO::SetApplicationPath(realpath(dirname(__FILE__)), array('controllers'));

    
// begin of the framework
    
BRICKOO::Begin();
 
    
// Maybe do here further initializing.
    // ....

    // end of the framework features
    // assigned calls will be executed 
    
BRICKOO::End();
?>




Include this file wherever you need the framework in you application.

What has happened in this file?

Your script have to call initialize.php initially.
The needed application paths to the current directory and temp folders are assigned.

BRIKCOO::Begin() starts the framework.
To be more precisely: The AutoLoader is starting and is loading classes if required.
The ErrorHandler which intercepts PHP's error messages and the ExceptionHandler which throws exceptions in case of serious errors caused by the framework, are starting as well.

After all work is done BRICKOO::End() is called which executes assigned callbacks and unbinds the autoloader and handlers.



Administration