예제 #1
0
	Check our installation
*/
if (Config::load() === false) {
    // looks like we are missing a config file
    echo file_get_contents(PATH . 'system/admin/theme/error_config.php');
    exit(1);
}
/*
	Debug options
	Running with debug enabled should report all errors
*/
if (Config::get('debug')) {
    // report all errors
    error_reporting(E_ALL);
    // show all error uncaught
    ini_safe_set('display_errors', true);
}
// Register the default timezone for the application.
date_default_timezone_set(Config::get('application.timezone'));
// Register the PHP exception handler.
set_exception_handler(array('Error', 'exception'));
// Register the PHP error handler.
set_error_handler(array('Error', 'native'));
// Register the shutdown handler.
register_shutdown_function(array('Error', 'shutdown'));
/*
	Start session handler
*/
Session::start();
/*
	Handle routing
예제 #2
0
파일: run.php 프로젝트: reqshark/anchor-cms
require PATH . 'system/classes/autoload.php';
require PATH . 'system/classes/helpers.php';
// map classes
Autoloader::map(array('Schema' => PATH . 'upgrade/classes/schema.php', 'Migrations' => PATH . 'upgrade/classes/migrations.php'));
// tell the autoloader where to find classes
Autoloader::directory(array(PATH . 'system/classes/'));
// register the auto loader
Autoloader::register();
/**
	Report all errors let our error class decide which to display
*/
error_reporting(-1);
/**
	Error display will be handled by our error class
*/
ini_safe_set('display_errors', false);
// Register the default timezone for the application.
date_default_timezone_set(Config::get('application.timezone'));
// Register the PHP exception handler.
set_exception_handler(array('Error', 'exception'));
// Register the PHP error handler.
set_error_handler(array('Error', 'native'));
// Register the shutdown handler.
register_shutdown_function(array('Error', 'shutdown'));
// load current config file
Config::load(PATH . 'config.php');
// add and apply migrations
require PATH . 'upgrade/migrations.php';
// write any config changes
Config::write(PATH . 'config.php', Config::get());
// redirect
예제 #3
0
*/
error_reporting(-1);
/**
	Error display will be handled by our error class
*/
ini_safe_set('display_errors', false);
/**
	Disable magic quotes
	note: magic quotes is deprecated in PHP 5.3
	src: php.net/manual/en/security.magicquotes.disabling.php
*/
if (function_exists('get_magic_quotes_gpc')) {
    if (get_magic_quotes_gpc()) {
        ini_safe_set('magic_quotes_gpc', false);
        ini_safe_set('magic_quotes_runtime', false);
        ini_safe_set('magic_quotes_sybase', false);
    }
}
/**
	Check our installation
*/
if (Config::load(PATH . 'config.php') === false) {
    // looks like we are missing a config file
    echo file_get_contents(PATH . 'system/admin/theme/error_config.php');
    exit(1);
}
// Register the default timezone for the application.
date_default_timezone_set(Config::get('application.timezone'));
// Register the PHP exception handler.
set_exception_handler(array('Error', 'exception'));
// Register the PHP error handler.