示例#1
0
文件: index.php 项目: palmic/lbox
require "lBox/lib/loader.php";
session_start();
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
    ob_start("ob_gzhandler");
} else {
    ob_start();
}
//DbControl::$debug = "firephp";
//LBoxCache::$debug = true;
//LBoxLoaderConfig::getInstance()->debug = true;
DEFINE("LBOX_PATH_TEMPLATES_PAGES", LBoxConfigSystem::getInstance()->getParamByPath("pages/templates/path"));
DEFINE("LBOX_PATH_TEMPLATES_COMPONENTS", LBoxConfigSystem::getInstance()->getParamByPath("components/templates/path"));
DEFINE("LBOX_PATH_TEMPLATES_LAYOUTS", LBoxConfigSystem::getInstance()->getParamByPath("layouts/templates/path"));
DEFINE("LBOX_PATH_FILES_I18N", LBoxConfigSystem::getInstance()->getParamByPath("i18n/globalfiles/path"));
try {
    LBoxFront::run();
} catch (Exception $e) {
    switch (LBoxConfigSystem::getInstance()->getParamByPath("debug/exceptions")) {
        case 1:
            echo getExceptionNotice($e);
            break;
        case -1:
            if (LBOX_REQUEST_IP == "127.0.0.1") {
                echo getExceptionNotice($e);
            } else {
                echo $e->getMessage();
            }
            break;
        case 0:
            echo $e->getMessage();
            break;