mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
check easyinstall every 30 days
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9079 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e024fad8a9
commit
43f4cde8e7
1 changed files with 37 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
var $layout_list;
|
||||
var $xeMenuTitle;
|
||||
var $easyinstallCheckFile = './files/env/easyinstall_last';
|
||||
|
||||
/**
|
||||
* @brief Initilization
|
||||
|
|
@ -61,8 +62,44 @@
|
|||
if($db_info->https_port) Context::set('https_port', $db_info->https_port);
|
||||
|
||||
$this->showSendEnv();
|
||||
$this->checkEasyinstall();
|
||||
}
|
||||
|
||||
function checkEasyinstall()
|
||||
{
|
||||
$lastTime = (int)FileHandler::readFile($this->easyinstallCheckFile);
|
||||
if ($lastTime > time() - 60*60*24*30) return;
|
||||
|
||||
$oAutoinstallModel = &getModel('autoinstall');
|
||||
$params = array();
|
||||
$params["act"] = "getResourceapiLastupdate";
|
||||
$body = XmlGenerater::generate($params);
|
||||
$buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
|
||||
$xml_lUpdate = new XmlParser();
|
||||
$lUpdateDoc = $xml_lUpdate->parse($buff);
|
||||
$updateDate = $lUpdateDoc->response->updatedate->body;
|
||||
|
||||
if (!$updateDate)
|
||||
{
|
||||
$this->_markingCheckEasyinstall();
|
||||
return;
|
||||
}
|
||||
|
||||
$item = $oAutoinstallModel->getLatestPackage();
|
||||
if(!$item || $item->updatedate < $updateDate)
|
||||
{
|
||||
$oController = &getAdminController('autoinstall');
|
||||
$oController->_updateinfo();
|
||||
}
|
||||
$this->_markingCheckEasyinstall();
|
||||
}
|
||||
|
||||
function _markingCheckEasyinstall()
|
||||
{
|
||||
$currentTime = time();
|
||||
FileHandler::writeFile($this->easyinstallCheckFile, $currentTime);
|
||||
}
|
||||
|
||||
function makeGnbUrl($module = 'admin')
|
||||
{
|
||||
global $lang;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue