optimizer_filecheck.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: optimizer_filecheck.php 31344 2012-08-15 04:01:32Z zhangjie $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class optimizer_filecheck {
  12. public function __construct() {
  13. }
  14. public function check() {
  15. global $_G;
  16. $dateline = C::t('common_cache')->fetch('checktools_filecheck');
  17. $dateline = dunserialize($dateline['cachevalue']);
  18. $dateline = $dateline['dateline'];
  19. if(($_G['timestamp'] - $dateline) > 86400 * 90) {
  20. $return = array('status' => 1, 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_filecheck_advice'));
  21. } else {
  22. $return = array('status' => 0, 'type' => 'none', 'lang' => lang('optimizer', 'optimizer_filecheck_lastcheck').dgmdate($dateline));
  23. }
  24. return $return;
  25. }
  26. public function optimizer() {
  27. global $_G;
  28. $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php';
  29. dheader('Location: '.$_G['siteurl'].$adminfile.'?action=checktools&operation=filecheck');
  30. }
  31. }
  32. ?>