diff -r e3d7322305bf -r 5e1f1e916419 punbb/include/essentials.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/punbb/include/essentials.php Sat Apr 05 23:56:45 2008 -0400 @@ -0,0 +1,101 @@ +install.php to install PunBB first.'); + + +// Record the start time (will be used to calculate the generation time for the page) +list($usec, $sec) = explode(' ', microtime()); +$pun_start = ((float)$usec + (float)$sec); + +// Make sure PHP reports all errors except E_NOTICE. PunBB supports E_ALL, but a lot of scripts it may interact with, do not. +error_reporting(E_ALL); + +// Force POSIX locale (to prevent functions such as strtolower() from messing up UTF-8 strings) +setlocale(LC_CTYPE, 'C'); + +// If the cache directory is not specified, we use the default setting +if (!defined('PUN_CACHE_DIR')) + define('PUN_CACHE_DIR', PUN_ROOT.'cache/'); + + +// Load DB abstraction layer and connect +require PUN_ROOT.'include/dblayer/common_db.php'; + +// Start a transaction +$pun_db->start_transaction(); + + +// Load cached config +if (file_exists(PUN_CACHE_DIR.'cache_config.php')) + include PUN_CACHE_DIR.'cache_config.php'; + +if (!defined('PUN_CONFIG_LOADED')) +{ + require_once PUN_ROOT.'include/cache.php'; + generate_config_cache(); + require PUN_CACHE_DIR.'cache_config.php'; +} + + +// Load hooks +if (file_exists(PUN_CACHE_DIR.'cache_hooks.php')) + include PUN_CACHE_DIR.'cache_hooks.php'; + +if (!defined('PUN_HOOKS_LOADED')) +{ + require_once PUN_ROOT.'include/cache.php'; + generate_hooks_cache(); + require PUN_CACHE_DIR.'cache_hooks.php'; +} + + +define('PUN_ESSENTIALS_LOADED', 1); \ No newline at end of file