mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
cache rss + redis require 2.0
This commit is contained in:
@@ -663,6 +663,16 @@ class Install
|
||||
return compact('version', 'match');
|
||||
}
|
||||
|
||||
public function getRedisVersionInfo(): array
|
||||
{
|
||||
global $Cache;
|
||||
$redis = $Cache->getRedis();
|
||||
$result = $redis->info();
|
||||
$version = $result['redis_version'];
|
||||
$match = version_compare($version, '2.0.0', '>=');
|
||||
return compact('version', 'match');
|
||||
}
|
||||
|
||||
public function checkLock()
|
||||
{
|
||||
$fullFilename = ROOT_PATH . $this->lockFile;
|
||||
|
||||
@@ -104,6 +104,7 @@ if ($currentStep == 4) {
|
||||
$tableRows = $settingTableRows['table_rows'];
|
||||
$pass = $settingTableRows['pass'];
|
||||
$mysqlInfo = $install->getMysqlVersionInfo();
|
||||
$redisInfo = $install->getREdisVersionInfo();
|
||||
while ($isPost) {
|
||||
set_time_limit(300);
|
||||
try {
|
||||
@@ -136,7 +137,11 @@ if ($currentStep == 5) {
|
||||
];
|
||||
}
|
||||
|
||||
if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) {
|
||||
if (
|
||||
!empty($error)
|
||||
|| (isset($mysqlInfo) && !$mysqlInfo['match'])
|
||||
|| (isset($redisInfo) && !$redisInfo['match'])
|
||||
) {
|
||||
$pass = false;
|
||||
}
|
||||
?>
|
||||
@@ -184,6 +189,9 @@ if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) {
|
||||
if (!$mysqlInfo['match']) {
|
||||
echo sprintf('<div class="text-red-700 pt-10">MySQL version: %s is too low, please use the newest version of 5.7 or above.</div>', $mysqlInfo['version']);
|
||||
}
|
||||
if (!$redisInfo['match']) {
|
||||
echo sprintf('<div class="text-red-700 pt-10">Redis version: %s is too low, please use 2.0.0 or above.</div>', $redisInfo['version']);
|
||||
}
|
||||
} elseif ($currentStep == 5) {
|
||||
echo $install->renderForm($userFormControls, '1/2', '1/4', '3/4');
|
||||
} elseif ($currentStep > $maxStep) {
|
||||
|
||||
@@ -157,6 +157,7 @@ if ($currentStep == 4) {
|
||||
$tableRows = $settingTableRows['table_rows'];
|
||||
$pass = $settingTableRows['pass'];
|
||||
$mysqlInfo = $update->getMysqlVersionInfo();
|
||||
$redisInfo = $update->getREdisVersionInfo();
|
||||
while ($isPost) {
|
||||
set_time_limit(300);
|
||||
try {
|
||||
@@ -175,7 +176,11 @@ if ($currentStep == 4) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) {
|
||||
if (
|
||||
!empty($error)
|
||||
|| (isset($mysqlInfo) && !$mysqlInfo['match'])
|
||||
|| (isset($redisInfo) && !$redisInfo['match'])
|
||||
) {
|
||||
$pass = false;
|
||||
}
|
||||
?>
|
||||
@@ -224,6 +229,9 @@ if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) {
|
||||
if (!$mysqlInfo['match']) {
|
||||
echo sprintf('<div class="text-red-700 pt-10">MySQL version: %s is too low, please use the newest version of 5.7 or above.</div>', $mysqlInfo['version']);
|
||||
}
|
||||
if (!$redisInfo['match']) {
|
||||
echo sprintf('<div class="text-red-700 pt-10">Redis version: %s is too low, please use 2.0.0 or above.</div>', $redisInfo['version']);
|
||||
}
|
||||
} elseif ($currentStep > $maxStep) {
|
||||
echo '<div class="text-green-900 text-6xl p-10">Congratulations, everything is ready!</div>';
|
||||
echo '<div class="mb-6">For questions, consult the upgrade log at: <code>' . $update->getLogFile() . '</code></div>';
|
||||
|
||||
Reference in New Issue
Block a user