Пример #1
0
<?php

$app = new System\Application();
// if the framework files and folders are within a folder in your local server, in my case, mvc.
// you have to set the base path.
$app->getInstance('router')->setBasePath('mvc/public/');
require_once BASE_PATH . 'app/routes.php';
$app->run();
Пример #2
0
// define some constant that will be useful. all the path constant must have no trailing slash.
if (!defined('DS')) {
    define('DS', DIRECTORY_SEPARATOR);
}
if (!defined('ROOT_PATH')) {
    define('ROOT_PATH', __DIR__);
}
if (!defined('MODULE_PATH')) {
    define('MODULE_PATH', ROOT_PATH . DS . 'modules');
}
if (!defined('CMS_PATH')) {
    define('CMS_PATH', MODULE_PATH . DS . 'Cms');
}
if (!defined('SYSTEM_PATH')) {
    define('SYSTEM_PATH', ROOT_PATH . DS . 'system');
}
if (!defined('STORAGE_PATH')) {
    define('STORAGE_PATH', ROOT_PATH . DS . 'storage');
}
if (!defined('APP_ENV')) {
    // define app environment. value can be development, test, production.
    define('APP_ENV', 'development');
}
// require composer autoload.
require_once SYSTEM_PATH . DS . 'vendor' . DS . 'autoload.php';
// global variables. this is very useful when you want to access it across the object.
global $Profiler;
// start the system application.
$sysapp = new System\Application();
$sysapp->run();
unset($Profiler, $sysapp);