<?php
$debug = true;
if($debug){
    ini_set('display_errors',0);
    error_reporting(E_ALL);
    function cache_shutdown_error() {

        $_error = error_get_last();

        if ($_error && in_array($_error['type'], array(1, 4, 16, 64, 256, 4096, E_ALL))) {

            echo '<font color=red>你的代码出错了：</font></br>';
            echo '致命错误:' . $_error['message'] . '</br>';
            echo '文件:' . $_error['file'] . '</br>';
            echo '在第' . $_error['line'] . '行</br>';

            $f = fopen(DIR_LOGS . 'cache_shutdown_error.log', 'a');
            fwrite($f, '致命错误:' . $_error['message'] . "\n");
            fwrite($f, '文件:' . $_error['file'] . "\n");
            fwrite($f, '在第' . $_error['line'] . "行\n");
            fwrite($f, str_repeat('-', 80) . "\n");
            fclose($f);
        }
    }

    register_shutdown_function("cache_shutdown_error");
}

// Version
define('VERSION', '3.0.3.2');

// Configuration
if (is_file('config.php')) {
	require_once('config.php');
}

// Install
if (!defined('DIR_APPLICATION')) {
	header('Location: install/index.php');
	exit;
}

// Startup
require_once(DIR_SYSTEM . 'startup.php');

start('catalog');