<?php
#error_reporting(E_ERROR | E_WARNING | E_PARSE);
#ini_set('display_errors', 1);

setlocale(LC_ALL, "es_ES");

define('DS', DIRECTORY_SEPARATOR);
define('ROOT', realpath(dirname(__FILE__)) . DS);
define('APP_PATH', ROOT . 'application' . DS);
define('APP_PATH_GOOGLE', ROOT . 'google-api-php-client' . DS);

try {
	require_once APP_PATH . 'Autoload.php';
	require_once APP_PATH_GOOGLE . 'vendor/autoload.php';
	require_once APP_PATH . 'Googleauth.php';

	Session::init();
	require_once APP_PATH . 'ConfigVar.php';
	require_once APP_PATH . 'Config.php';
	require_once APP_PATH . 'ConfigSL.php';

	$registry = Registry::getInstancia();
	$registry->_request = new Request();
	$registry->_db = DataBase::getInstancia();
	$registry->_dbcert = DataBaseCert::getInstancia();
	$registry->_db_ss = DataBaseServicioSocial::getInstancia();

	$registry->_model = new Model();
	$registry->_acl = new ACL();
	$registry->_process = new Process();
	$googleclient = new Google_Client();
	#var_dump($googleclient)       ;
	$registry->_googleclient = $googleclient;
	$registry->_googleoauth = new Googleauth($googleclient);
	
	Bootstrap::run($registry->_request);

} catch (Exception $e) {
	echo $e->getMessage();
}

?>
