} $install_path_rel .= '../'; } $install_path_rel .= 'install.php'; header('Location: ' . $install_path_rel); } // Define some constants @define('YD_WEBLOG_CACHE_PREFIX', 'YDF_L_'); @define('YD_WEBLOG_CACHE_SUFFIX', 'cache'); // First stab of includes YDInclude('YDRequest.php'); YDInclude(dirname(__FILE__) . '/config.php'); // Update the database prefix YDConfig::set('YD_DB_TABLEPREFIX', YDConfig::get('db_prefix', '')); // Get the cache filename $cache_file = YD_DIR_TEMP . '/' . YD_WEBLOG_CACHE_PREFIX . md5(YDRequest::getNormalizedCurrentUrl()) . '.' . YD_WEBLOG_CACHE_SUFFIX; @define('YD_WEBLOG_CACHE_FNAME', $cache_file); // Check if the user wanted to use caching if (YDConfig::get('use_cache', false)) { // Check if we allow caching if (sizeof($_POST) == 0) { // Check if there is a cache item for this request if (is_file(YD_WEBLOG_CACHE_FNAME)) { // Output the cached item $data = file_get_contents(YD_WEBLOG_CACHE_FNAME); // Include a cache filter if any @(include dirname(__FILE__) . '/cache_filter.php'); // Add the elapsed time $elapsed = $GLOBALS['timer']->getElapsed(); die($data . YD_CRLF . '<!-- #cached: ' . $elapsed . ' ms -->'); }