From: Tim Düsterhus Date: Tue, 15 May 2012 21:54:39 +0000 (+0200) Subject: Adding several health checks X-Git-Tag: 2.0.0_Beta_1~1028^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0800101bb40ec4f9afeb3166e742108204ca36f5;p=GitHub%2FWoltLab%2FWCF.git Adding several health checks - Disabling of cache (warning) - Using DebugMailSender (warning) - Fallback on DiskCache when using memcached or APC (error) - Fallback on GD when using Imagick (error) --- diff --git a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php index 9747d86362..e99495e390 100755 --- a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php @@ -1,12 +1,15 @@ healthDetails['warning'][] = WCF::getLanguage()->getDynamicVariable('wcf.acp.index.health.notWritable', array('file' => $file)); + if (!is_writable($file)) { + $this->healthDetails['warning'][] = WCF::getLanguage()->getDynamicVariable('wcf.acp.index.health.notWritable', array( + 'file' => $file + )); + } } for($i = 0; $i < 7; $i++) { if (file_exists(WCF_DIR.'log/'.date('Y-m-d', TIME_NOW - 86400 * $i).'.txt')) { - $this->healthDetails['error'][] = WCF::getLanguage()->getDynamicVariable('wcf.acp.index.health.exception', array('date' => TIME_NOW - 86400 * $i)); + $this->healthDetails['error'][] = WCF::getLanguage()->getDynamicVariable('wcf.acp.index.health.exception', array( + 'date' => TIME_NOW - 86400 * $i + )); break; } } + if (CacheHandler::getInstance()->getCacheSource() instanceof NoCacheSource) { + $this->healthDetails['warning'][] = WCF::getLanguage()->get('wcf.acp.index.health.noCacheSource'); + } + else if (!ClassUtil::isInstanceOf(CacheHandler::getInstance()->getCacheSource(), 'wcf\system\cache\source'.ucfirst(CACHE_SOURCE_TYPE).'CacheSource')) { + $this->healthDetails['error'][] = WCF::getLanguage()->getDynamicVariable('wcf.acp.index.health.cacheFallback', array( + 'shouldBe' => WCF::getLanguage()->get('wcf.acp.option.cache_source_type.'.CACHE_SOURCE_TYPE) + )); + } + + if (MAIL_SEND_METHOD === 'debug') { + $this->healthDetails['warning'][] = WCF::getLanguage()->get('wcf.acp.index.health.debugMailSender'); + } + + if (IMAGE_ADAPTER_TYPE === 'imagick' && !ImagickImageAdapter::isSupported()) { + $this->healthDetails['error'][] = WCF::getLanguage()->get('wcf.acp.index.health.imageAdapterFallback'); + } + EventHandler::getInstance()->fireAction($this, 'calculateHealth'); } catch (\Exception $e) {