miniMVC/index.php

60 lines
1.4 KiB
PHP
Raw Normal View History

2012-01-13 11:58:06 -05:00
<?php
/**
* MiniMVC
*
* Convention-based micro-framework for PHP
*
* @package miniMVC
2012-01-13 11:58:06 -05:00
* @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');
2012-01-13 11:58:06 -05:00
2012-05-03 16:07:40 -04:00
if(ENVIRONMENT == 'DEVELOPMENT')
{
error_reporting(-1);
}
2012-05-15 16:53:10 -04:00
else if(ENVIRONMENT == 'PRODUCTION')
{
error_reporting(0);
}
2012-01-13 11:58:06 -05:00
// Set the default paths
define('MM_BASE_PATH', __DIR__);
define('MM_SYS_PATH', __DIR__.'/sys/');
define('MM_APP_PATH', __DIR__.'/app/');
2012-05-03 16:07:40 -04:00
define('MM_MOD_PATH', MM_APP_PATH.'modules/');
// Determine the default site url
2012-01-13 11:58:06 -05:00
$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');
2012-01-13 11:58:06 -05:00
// Require the most important files
require(MM_SYS_PATH . "common.php");
2012-01-13 11:58:06 -05:00
// And away we go!
2012-05-16 16:47:36 -04:00
init();
2012-01-13 11:58:06 -05:00
// End of index.php