<?php
Error_Reporting( E_ERROR );

// Look for a composer auoloader
$here = realpath(dirname(__FILE__));
$isComposerInstall = false;
foreach(array($here . '/../vendor/autoload.php') as $composerAutoload) {
    if(file_exists($composerAutoload)) {
        require($composerAutoload);
        $isComposerInstall = true;
        break;
    }
}
if(!$isComposerInstall) {
    // when the composer autoload was found Agavi will already be loaded
    // load Agavi basics
    require('/var/projects/oar/vendor/agavi/agavi/etc/composer/bin/../../../src/agavi.php');
}

// +---------------------------------------------------------------------------+
// | An absolute filesystem path to our app/config.php script.                 |
// +---------------------------------------------------------------------------+
require('/var/projects/oar/app/config.php');

// +---------------------------------------------------------------------------+
// | Initialize the framework. You may pass an environment name to this method.|
// | By default the 'development' environment sets Agavi into a debug mode.    |
// | In debug mode among other things the cache is cleaned on every request.   |
// +---------------------------------------------------------------------------+
Agavi::bootstrap( 'production-prod_server' );

// +---------------------------------------------------------------------------+
// | Call the controller's dispatch method on the default context              |
// +---------------------------------------------------------------------------+
AgaviContext::getInstance('web')->getController()->dispatch();
?>
