Issue 1220 change the time of showing check env.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9977 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2011-12-22 06:14:49 +00:00
parent 43bf806909
commit ec58b0f88d

View file

@ -52,7 +52,7 @@
function checkEasyinstall() function checkEasyinstall()
{ {
$lastTime = (int)FileHandler::readFile($this->easyinstallCheckFile); $lastTime = (int)FileHandler::readFile($this->easyinstallCheckFile);
if ($lastTime > time() - 60*60*24*30) return; if ($lastTime > $_SERVER['REQUEST_TIME'] - 60*60*24*30) return;
$oAutoinstallModel = &getModel('autoinstall'); $oAutoinstallModel = &getModel('autoinstall');
$params = array(); $params = array();
@ -80,7 +80,7 @@
function _markingCheckEasyinstall() function _markingCheckEasyinstall()
{ {
$currentTime = time(); $currentTime = $_SERVER['REQUEST_TIME'];
FileHandler::writeFile($this->easyinstallCheckFile, $currentTime); FileHandler::writeFile($this->easyinstallCheckFile, $currentTime);
} }
@ -213,7 +213,7 @@
**/ **/
function dispAdminIndex() { function dispAdminIndex() {
// Get statistics // Get statistics
$args->date = date("Ymd000000", time()-60*60*24); $args->date = date("Ymd000000", $_SERVER['REQUEST_TIME']-60*60*24);
$today = date("Ymd"); $today = date("Ymd");
// Member Status // Member Status
@ -280,7 +280,7 @@
//Retrieve recent news and set them into context //Retrieve recent news and set them into context
$newest_news_url = sprintf("http://news.xpressengine.com/%s/news.php?version=%s&package=%s", _XE_LOCATION_, __ZBXE_VERSION__, _XE_PACKAGE_); $newest_news_url = sprintf("http://news.xpressengine.com/%s/news.php?version=%s&package=%s", _XE_LOCATION_, __ZBXE_VERSION__, _XE_PACKAGE_);
$cache_file = sprintf("%sfiles/cache/newest_news.%s.cache.php", _XE_PATH_, _XE_LOCATION_); $cache_file = sprintf("%sfiles/cache/newest_news.%s.cache.php", _XE_PATH_, _XE_LOCATION_);
if(!file_exists($cache_file) || filemtime($cache_file)+ 60*60 < time()) { if(!file_exists($cache_file) || filemtime($cache_file)+ 60*60 < $_SERVER['REQUEST_TIME']) {
// Considering if data cannot be retrieved due to network problem, modify filemtime to prevent trying to reload again when refreshing administration page // Considering if data cannot be retrieved due to network problem, modify filemtime to prevent trying to reload again when refreshing administration page
// Ensure to access the administration page even though news cannot be displayed // Ensure to access the administration page even though news cannot be displayed
FileHandler::writeFile($cache_file,''); FileHandler::writeFile($cache_file,'');
@ -324,7 +324,8 @@
Context::set('isUpdated', $isUpdated); Context::set('isUpdated', $isUpdated);
// gathering enviroment check // gathering enviroment check
$path = FileHandler::getRealPath('./files/env/'.__ZBXE_VERSION__); $mainVersion = join('.', array_slice(explode('.', __ZBXE_VERSION__), 0, 2));
$path = FileHandler::getRealPath('./files/env/'.$mainVersion);
$isEnviromentGatheringAgreement = false; $isEnviromentGatheringAgreement = false;
if(file_exists($path)) $isEnviromentGatheringAgreement = true; if(file_exists($path)) $isEnviromentGatheringAgreement = true;
Context::set('isEnviromentGatheringAgreement', $isEnviromentGatheringAgreement); Context::set('isEnviromentGatheringAgreement', $isEnviromentGatheringAgreement);
@ -423,6 +424,7 @@
$server = 'http://collect.xpressengine.com/env/img.php?'; $server = 'http://collect.xpressengine.com/env/img.php?';
$path = './files/env/'; $path = './files/env/';
$install_env = $path . 'install'; $install_env = $path . 'install';
$mainVersion = join('.', array_slice(explode('.', __ZBXE_VERSION__), 0, 2));
if(file_exists(FileHandler::getRealPath($install_env))) { if(file_exists(FileHandler::getRealPath($install_env))) {
$oAdminAdminModel = &getAdminModel('admin'); $oAdminAdminModel = &getAdminModel('admin');
@ -431,10 +433,10 @@
Context::addHtmlFooter($img); Context::addHtmlFooter($img);
FileHandler::removeDir($path); FileHandler::removeDir($path);
FileHandler::writeFile($path.__ZBXE_VERSION__,'1'); FileHandler::writeFile($path.$mainVersion,'1');
} }
else if(isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path.__ZBXE_VERSION__))) else if(isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path.$mainVersion)))
{ {
if($_SESSION['enviroment_gather']=='Y') if($_SESSION['enviroment_gather']=='Y')
{ {
@ -445,7 +447,7 @@
} }
FileHandler::removeDir($path); FileHandler::removeDir($path);
FileHandler::writeFile($path.__ZBXE_VERSION__,'1'); FileHandler::writeFile($path.$mainVersion,'1');
unset($_SESSION['enviroment_gather']); unset($_SESSION['enviroment_gather']);
} }
} }