. */ // Base application path if (!defined('BASE_PATH')) define('BASE_PATH', dirname(dirname(__FILE__))); define('DATA_PATH', BASE_PATH . '/datas'); // Are we in installation procedure ? if (!defined('IS_INSTALL')) define('IS_INSTALL', false); error_reporting(E_ALL); define('ENABLE_DEBUG', true); function catchError($errno, $errstr, $errfile, $errline, $errcontext) { $error = "Error happened !\n\n". $errno." - ".$errstr."\n\nIn: ". $errfile . ":" . $errline."\n\n". print_r($errcontext, true); if (ENABLE_DEBUG) { echo '
';
        echo $error;
        echo '
'; exit; } } set_error_handler('catchError'); function strip_slashes_from_user_data(&$array) { foreach($array as $k => $v) { if (is_array($v)) { strip_slashes_from_user_data($array[$k]); continue; } $array[$k] = stripslashes($v); } } if (get_magic_quotes_gpc()) { strip_slashes_from_user_data($_GET); strip_slashes_from_user_data($_POST); strip_slashes_from_user_data($_COOKIE); } // Si pas de config, installation if (!file_exists(BASE_PATH.'/config.local.php') && !IS_INSTALL) { header('Location: ./install.php'); exit; } if (!IS_INSTALL) { require_once BASE_PATH.'/config.local.php'; require_once BASE_PATH.'/include/class.nanokubbe.php'; $nk = new NanoKubbe; } if (!defined('LOCAL_TIMEZONE')) define('LOCAL_TIMEZONE', 'Europe/Paris'); date_default_timezone_set(LOCAL_TIMEZONE); // Template_Lite require_once BASE_PATH . '/include/template_lite/class.template.php'; $tpl = new Template_Lite; $tpl->cache = 1; $tpl->cache_lifetime = 24 * 3600; $tpl->config_booleanize = true; $tpl->config_fix_new_lines = true; $tpl->config_read_hidden = true; $tpl->reserved_template_varname = 'tpl'; $tpl->compile_dir = BASE_PATH . '/cache/compiled'; $tpl->cache_dir = BASE_PATH . '/cache/pages'; $tpl->template_dir = BASE_PATH . '/datas/templates'; $tpl->config_dir = BASE_PATH . '/datas/pages'; $tpl->plugins_dir[] = BASE_PATH . '/datas/plugins'; if (isset($nk) && is_object($nk)) { $tpl->assign('web_path', $nk->webPath); } function tpl_get_page_uri($page) { global $nk; return $nk->getPageURI($page); } $tpl->register_modifier('get_page_uri', 'tpl_get_page_uri'); ?>