让time.xml每天生成一次

This commit is contained in:
wlx 2009-12-20 08:06:36 +00:00
parent a702606cdd
commit c3edc3f083
1 changed files with 4 additions and 0 deletions

View File

@ -266,6 +266,9 @@ class DataController extends Zend_Controller_Action
* todo:实现xml的缓存基于时间的缓存每天基于元数据修改的缓存每次导入后都重新生成一次。 * todo:实现xml的缓存基于时间的缓存每天基于元数据修改的缓存每次导入后都重新生成一次。
*/ */
function timelineAction() function timelineAction()
{
$fn="time.xml";
if (!file_exists($fn) || (time()-filemtime($fn)>3600*24))
{ {
$dateformat="D M j Y G:i:s O"; $dateformat="D M j Y G:i:s O";
$md = new MetadataTable(); $md = new MetadataTable();
@ -286,6 +289,7 @@ class DataController extends Zend_Controller_Action
$fp=fopen('time.xml','w'); $fp=fopen('time.xml','w');
fwrite($fp,$timexml); fwrite($fp,$timexml);
fclose($fp); fclose($fp);
}
//$this->_helper->layout->disableLayout(); //$this->_helper->layout->disableLayout();
} }
/* /*