<?php
defined('PHP168_PATH') or die();

/**
* 首页静态
**/

$system = &$core->load_system('sites');
//抗干扰
unset($this_module, $CAT, $data, $TITLE, $SEO_KEYWORDS, $SEO_DESCRIPTION);

//定义生成静态的常量
defined('P8_GENERATE_HTML') or define('P8_GENERATE_HTML', true);
if(!empty($system->site['ipordomain']) && !empty($system->site['domain']))
{
	$index_file = PHP168_PATH.$system->name.'/html/'.$system->SITE.'/index.html';
	if(!empty($system->site['config']['indexhtml'])
		&& (!file_exists($index_file) || filemtime($index_file)<time()-$system->site['config']['indexhtml_ex']*60))
	{
		$_SERVER['_REQUEST_URI'] = $system->controller;

		ob_start();
		require PHP168_PATH .'s.php';

		$content = ob_get_clean();

		write_file($index_file, $content);
		@chmod($index_file, 0644);
	}
}
