예제 #1
0
 /**
  * @see	wcf\system\template\TemplateEngine::__construct()
  */
 protected function init()
 {
     parent::init();
     $this->templatePaths = array(1 => WCF_DIR . 'acp/templates/');
     $this->compileDir = WCF_DIR . 'acp/templates/compiled/';
     if (!defined('NO_IMPORTS')) {
         $this->loadTemplateListeners();
     }
 }
예제 #2
0
/*| database |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/
try {
    DB::construct($cfg['db']['engine']);
    DB::connect($cfg['db']['host'], $cfg['db']['username'], $cfg['db']['password'], $cfg['db']['port']);
    DB::selectDB($cfg['db']['database']);
    DB::setPrefix($cfg['db']['table_prefix']);
    // i always unset the db password once it is not needed
    unset($cfg['db']['password']);
} catch (DBError $e) {
    trigger_error("Database Connection Error: " . $e->getMessage());
    echo "Database Connection Error. Reload the page to try again.";
    exit;
}
/*| template engine |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/
Session::init($cfg['guid']);
TemplateEngine::init($cfg['dwoo_template_directory'], $cfg['dwoo_compiled_directory'], $cfg['dwoo_cache_directory']);
/*| magic quotes |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/
if (get_magic_quotes_gpc()) {
    function stripslashes_recurse($value)
    {
        $value = is_array($value) ? array_map('stripslashes_recurse', $value) : stripslashes($value);
        return $value;
    }
    $_GET = array_map('stripslashes_recurse', $_GET);
    $_POST = array_map('stripslashes_recurse', $_POST);
    $_COOKIE = array_map('stripslashes_recurse', $_COOKIE);
}
/*| debug |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|*/
if ($cfg['debug']) {
    if (trim($cfg['firephp_path']) != '') {
        require_once $cfg['firephp_path'];