<?php
/**
 * Application boostrap file
 *
 * Initializes an zend framework application, and runs her.
 *
 * @package koubel homepage
 * @author Miroslav Kubelik (koubel@volny.cz)
 * @copyright Copyright (c) 2007-2009 Miroslav Kubelik
 * @license http://opensource.org/licenses/gpl-license.php GNU GPL
 */

//debug settings for error levels and reporting, it's used only for this
//short bootstraping global code, before application ini file is evaluated
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors','On');

/** include path wrapper */
require_once dirname(__FILE__) . "/../library/IncludePath.php";

//add the application library directory into include path
IncludePath::add(realpath(dirname(__FILE__) . "/../library"));

//define path to the application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

//define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

//add the zend framework path into include path if defined
IncludePath::add(defined('ZF_PATH')
    ? ZF_PATH
    : (getenv('ZF_PATH') ? getenv('ZF_PATH') : realpath(dirname(__FILE__) . '/../library'))
);

// Create application, bootstrap, and run
require_once "Zend/Application.php";
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);

$application->bootstrap();
$application->run();
