Location: PHPKode > scripts > PhpIndex Light > library/PhpIndex/Bootstrap.php
<?php
/**
* PhpIndex bootstrap file
*
* $Id: $
*
* $LastChangedBy: $
*
* $LastChangedDate: $
*
* $Rev: $
*
* @author Indiana Jones <hide@address.com>
* @version 1.0
* @copyright 2010 PhpIndex
* @package PhpIndex
*/

require_once(dirname(__FILE__) . '/DirectoryBrowser.php');
require_once(dirname(__FILE__) . '/FrontController.php');
require_once(dirname(__FILE__) . '/Registry.php');

class PhpIndex_Bootstrap
{
    /**
     * Main run method
     *
     * @param array $config
     * @return void
     */
    public function run($config)
    {
        $this->_initConfig($config);
        $request = $this->_initFrontController();
        $this->_initDirectoryBrowser($request);
    }

    /**
     * Initialize config using registry
     *
     * @param array $config
     * @return void
     */
    private function _initConfig($config)
    {
        $registry = PhpIndex_Registry::getInstance();
        $registry->config = $config;
    }

    /**
     * Initilize the front controller
     *
     * @return string
     */
    private function _initFrontController()
    {
        $frontController = new PhpIndex_FrontController();
        $request = $frontController->parseRequest();

        return $request;
    }

    /**
     * Initilize the directory browser
     *
     * @param string $request
     * @return void
     */
    private function _initDirectoryBrowser($request)
    {
        $browser = new PhpIndex_DirectoryBrowser();
        $browser->run($request);
    }
}

/* EOF */
Return current item: PhpIndex Light