1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-05 04:37:51 +02:00

Core Improvements: Next Round #79 #80

This commit is contained in:
Awilum
2013-01-07 00:52:00 +02:00
parent 0f59fa83fc
commit 26a605bf50
12 changed files with 665 additions and 296 deletions

View File

@@ -1,13 +1,28 @@
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
/**
* Include engine core
* Report All Errors
*
* By setting error reporting to -1, we essentially force PHP to report
* every error, and this is guranteed to show every error on future
* releases of PHP. This allows everything to be fixed early!
*/
include ROOT . '/libraries/Gelato/Gelato.php';
include ROOT . '/engine/Core.php';
error_reporting(-1);
/**
* Set core environment
* Monstra requires PHP 5.2.0 or greater
*/
if (version_compare(PHP_VERSION, "5.2.0", "<")) {
exit("Monstra requires PHP 5.2.0 or greater.");
}
/**
* Include Monstra Engine Core
*/
include ROOT . DS .'engine'. DS .'Core.php';
/**
* Set Monstra Core Environment
*
* Monstra has four predefined environments:
* Core::DEVELOPMENT - The development environment.
@@ -18,36 +33,6 @@ include ROOT . '/engine/Core.php';
Core::$environment = Core::DEVELOPMENT;
/**
* Monstra requires PHP 5.2.0 or greater
*/
if (version_compare(PHP_VERSION, "5.2.0", "<")) {
exit("Monstra requires PHP 5.2.0 or greater.");
}
/**
* Report Errors
*/
if (Core::$environment == Core::PRODUCTION) {
/**
* Report All Errors
*
* By setting error reporting to -1, we essentially force PHP to report
* every error, and this is guranteed to show every error on future
* releases of PHP. This allows everything to be fixed early!
*/
error_reporting(0);
} else {
/**
* Production environment
*/
error_reporting(-1);
}
/**
* Initialize core
* Initialize Core
*/
Core::init();