60 lines
1.4 KiB
PHP
60 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* MiniMVC
|
|
*
|
|
* Convention-based micro-framework for PHP
|
|
*
|
|
* @package miniMVC
|
|
* @author Timothy J. Warren
|
|
* @copyright Copyright (c) 2011 - 2012
|
|
* @link https://github.com/timw4mail/miniMVC
|
|
* @license http://philsturgeon.co.uk/code/dbad-license
|
|
*/
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
/**
|
|
* miniMVC bootstrap file
|
|
*
|
|
* @package miniMVC
|
|
* @subpackage App
|
|
*/
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// Set as either DEVELOPMENT or PRODUCTION
|
|
// DEVELOPMENT enables error reporting
|
|
// PRODUCTION disables error reporting
|
|
define('ENVIRONMENT', 'DEVELOPMENT');
|
|
|
|
if(ENVIRONMENT == 'DEVELOPMENT')
|
|
{
|
|
error_reporting(-1);
|
|
}
|
|
else if(ENVIRONMENT == 'PRODUCTION')
|
|
{
|
|
error_reporting(0);
|
|
}
|
|
|
|
// Set the default paths
|
|
define('MM_BASE_PATH', __DIR__);
|
|
define('MM_SYS_PATH', __DIR__.'/sys/');
|
|
define('MM_APP_PATH', __DIR__.'/app/');
|
|
define('MM_MOD_PATH', MM_APP_PATH.'modules/');
|
|
|
|
// Determine the default site url
|
|
$ri = $_SERVER['REQUEST_URI'];
|
|
$ind_pos = stripos($ri, "index.php");
|
|
$default_path = ($ind_pos !== FALSE) ? substr($ri, 0, $ind_pos) : $ri;
|
|
$default_baseurl = "//" . str_replace("//", "/", $_SERVER['HTTP_HOST']. $default_path);
|
|
|
|
// Require the basic configuratio file
|
|
require(MM_APP_PATH.'config/config.php');
|
|
|
|
// Require the most important files
|
|
require(MM_SYS_PATH . "common.php");
|
|
|
|
// And away we go!
|
|
init();
|
|
|
|
// End of index.php
|