<?php
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
$inicio = microtime(true);
if (file_exists('./install/install.php')) {
    // Start installation if the file "install.php" exists in the directory "install"
    require './install/install.php';
} else {
    // Define base path obtainable throughout the whole application
    defined('BASE_PATH')
        || define('BASE_PATH', realpath(dirname(__FILE__)));
    // Define path to application directory
    defined('APPLICATION_PATH')
        || define('APPLICATION_PATH', BASE_PATH . '/application');
        // Define path to application directory
    defined('MODULES_PATH')
        || define('MODULES_PATH', APPLICATION_PATH . '/modules');
    // Define application environment
    defined('APPLICATION_ENV')
        || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
    // Set include path to Zend (and other) libraries
	if (set_include_path(BASE_PATH . '/library' .
        PATH_SEPARATOR . APPLICATION_PATH . '/models' .
        PATH_SEPARATOR . get_include_path() .
        PATH_SEPARATOR . '.'
    ) === false) {
	  die('Fatal error: ini_set/set_include_path does not work.');
	}else{
	} 
    // Require Zend_Application
    require_once 'Zend/Application.php';
    // Create application
    $application = new Zend_Application(
        APPLICATION_ENV,
        APPLICATION_PATH . '/configs/application.ini'
#        APPLICATION_PATH . '/data/config.xml'
    );
    // Bootstrap, and run application
    $application->bootstrap();
    $application->run();
}
 $final = microtime(true);
 $total= $final- $inicio;
 //echo 'Tiempo en ejecutar el script: '.$total.' segundos';

?>
