Exemplo n.º 1
0
<?php

/**
 * Punto de entrada de la aplicacion.
 * @author Victor Hugo Cornejo Calderon <*****@*****.**>
 * @filesource index.php
 */
try {
    define('DS', DIRECTORY_SEPARATOR);
    define('ROOT', realpath(dirname(__DIR__)) . DS);
    define('FILE_CONFIG_APP', ROOT . 'application' . DS . 'config.ini');
    set_include_path(ROOT);
    spl_autoload_register();
    \core\Bootstrap::run(new \core\Request());
} catch (\core\AppException $ex) {
    $error = new \application\controllers\errorController();
    $error->app($ex);
} catch (\Exception $ex) {
    $error = new \application\controllers\errorController();
    $error->system($ex);
}
Exemplo n.º 2
0
 * This is the file where everything starts. The
 * configuration is required, the auto load class
 * is declared and the Bootstrap is initialized.
 *
 * @package     InMVC
 */
if (file_exists('../application/config.php')) {
    require '../application/config.php';
} else {
    die("There's no configuration file.");
}
require '../application/helpers/dir.php';
use Helpers\Dir;
/**
 * Auto Load Function
 *
 * This function is able to Auto Load the necessary
 * classes that are inside the library folder.
 *
 * @param string $className The name of the unknown class.
 */
function autoLoad($className)
{
    $file = Dir::preparePath(ROOT . $className . '.php');
    if (file_exists($file)) {
        require $file;
    }
}
spl_autoload_register('autoLoad');
\Core\Bootstrap::init();