From 4dbe8cee4913e2a6a58142a6ea54446936bc1aa2 Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 22 May 2024 15:32:44 +0800 Subject: [PATCH] * install: check if the apcu extension is loaded when install zentao. --- module/install/control.php | 1 + module/install/ui/step1.html.php | 2 +- module/install/zen.php | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/module/install/control.php b/module/install/control.php index 546a369c01..655ee62480 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -94,6 +94,7 @@ class install extends control $this->view->curlResult = $this->installZen->checkCURL(); $this->view->filterResult = $this->installZen->checkFilter(); $this->view->iconvResult = $this->installZen->checkIconv(); + $this->view->apcuResult = $this->installZen->checkAPCu(); $this->view->tmpRootInfo = $this->installZen->getTmpRoot(); $this->view->tmpRootResult = $this->installZen->checkTmpRoot(); $this->view->dataRootInfo = $this->installZen->getDataRoot(); diff --git a/module/install/ui/step1.html.php b/module/install/ui/step1.html.php index 01fe892a47..fa9a8ae6a3 100644 --- a/module/install/ui/step1.html.php +++ b/module/install/ui/step1.html.php @@ -13,7 +13,7 @@ namespace zin; set::zui(true); $checkTrs = array(); -$extendItems = array('pdo', 'pdoMySQL', 'json', 'openssl', 'mbstring', 'zlib', 'curl', 'filter', 'iconv'); +$extendItems = array('pdo', 'pdoMySQL', 'json', 'openssl', 'mbstring', 'zlib', 'curl', 'filter', 'iconv', 'apcu'); $dirItems = array('tmpRoot', 'dataRoot', 'session'); foreach($extendItems as $extendItem) { diff --git a/module/install/zen.php b/module/install/zen.php index 5af3f5ca62..8ecfbea52f 100644 --- a/module/install/zen.php +++ b/module/install/zen.php @@ -188,6 +188,18 @@ class installZen extends install return extension_loaded('iconv') ? 'ok' : 'fail'; } + /** + * 检查是否安装了apcu扩展。 + * Check apcu extension. + * + * @access protected + * @return string ok|fail + */ + protected function checkAPCu(): string + { + return extension_loaded('apcu') ? 'ok' : 'fail'; + } + /** * 检查tmp目录的完整性和可写性。 * Check tmpRoot.