让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

@ -267,6 +267,9 @@ class DataController extends Zend_Controller_Action
*/ */
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();
$db=$md->getAdapter(); $db=$md->getAdapter();
@ -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();
} }
/* /*