mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 15:27:24 +08:00
install&update add REDIS_PASSWORD
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.4');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.4');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-04-17');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-04-19');
|
||||||
defined('IN_TRACKER') || define('IN_TRACKER', true);
|
defined('IN_TRACKER') || define('IN_TRACKER', true);
|
||||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||||
|
|||||||
@@ -23,7 +23,11 @@ class Install
|
|||||||
'searchbox', 'secondicons', 'sources', 'standards', 'stylesheets', 'sysoppanel', 'teams', 'torrents_state', 'uploadspeed',
|
'searchbox', 'secondicons', 'sources', 'standards', 'stylesheets', 'sysoppanel', 'teams', 'torrents_state', 'uploadspeed',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $envNames = ['TIMEZONE', 'DB_HOST', 'DB_PORT', 'DB_USERNAME', 'DB_PASSWORD', 'DB_DATABASE', 'REDIS_HOST', 'REDIS_PORT', 'REDIS_DB'];
|
protected $envNames = [
|
||||||
|
'TIMEZONE',
|
||||||
|
'DB_HOST', 'DB_PORT', 'DB_USERNAME', 'DB_PASSWORD', 'DB_DATABASE',
|
||||||
|
'REDIS_HOST', 'REDIS_PORT', 'REDIS_DB', 'REDIS_PASSWORD',
|
||||||
|
];
|
||||||
|
|
||||||
protected array $requiredExtensions = ['ctype', 'fileinfo', 'json', 'mbstring', 'openssl', 'pdo_mysql', 'tokenizer', 'xml', 'mysqli', 'bcmath', 'redis', 'gd', ];
|
protected array $requiredExtensions = ['ctype', 'fileinfo', 'json', 'mbstring', 'openssl', 'pdo_mysql', 'tokenizer', 'xml', 'mysqli', 'bcmath', 'redis', 'gd', ];
|
||||||
protected array $optionalExtensions = [
|
protected array $optionalExtensions = [
|
||||||
@@ -468,6 +472,9 @@ class Install
|
|||||||
mysql_connect($newData['DB_HOST'], $newData['DB_USERNAME'], $newData['DB_PASSWORD'], $newData['DB_DATABASE'], $newData['DB_PORT']);
|
mysql_connect($newData['DB_HOST'], $newData['DB_USERNAME'], $newData['DB_PASSWORD'], $newData['DB_DATABASE'], $newData['DB_PORT']);
|
||||||
$redis = new \Redis();
|
$redis = new \Redis();
|
||||||
$redis->connect($newData['REDIS_HOST'], $newData['REDIS_PORT'] ?: 6379);
|
$redis->connect($newData['REDIS_HOST'], $newData['REDIS_PORT'] ?: 6379);
|
||||||
|
if (!empty($data['REDIS_PASSWORD'])) {
|
||||||
|
$redis->auth($data['REDIS_PASSWORD']);
|
||||||
|
}
|
||||||
if (isset($newData['REDIS_DB'])) {
|
if (isset($newData['REDIS_DB'])) {
|
||||||
if (!ctype_digit($newData['REDIS_DB']) || $newData['REDIS_DB'] < 0 || $newData['REDIS_DB'] > 15) {
|
if (!ctype_digit($newData['REDIS_DB']) || $newData['REDIS_DB'] < 0 || $newData['REDIS_DB'] > 15) {
|
||||||
throw new \InvalidArgumentException("invalid redis database: " . $newData['REDIS_DB']);
|
throw new \InvalidArgumentException("invalid redis database: " . $newData['REDIS_DB']);
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) {
|
|||||||
unset($copy);
|
unset($copy);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="mt-10 text-center">
|
<div class="mt-2 text-center">
|
||||||
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">Prev</button>
|
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">Prev</button>
|
||||||
<?php if ($currentStep <= $maxStep) {?>
|
<?php if ($currentStep <= $maxStep) {?>
|
||||||
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>Next</button>
|
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>Next</button>
|
||||||
@@ -216,7 +216,7 @@ if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m-10 text-center">
|
<div class="m-2 text-center">
|
||||||
Welcome to the NexusPHP installer, if you have any questions, click<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">here</a>for help.
|
Welcome to the NexusPHP installer, if you have any questions, click<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">here</a>for help.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) {
|
|||||||
unset($copy);
|
unset($copy);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="mt-10 text-center">
|
<div class="mt-2 text-center">
|
||||||
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">Prev</button>
|
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">Prev</button>
|
||||||
<?php if ($currentStep <= $maxStep) {?>
|
<?php if ($currentStep <= $maxStep) {?>
|
||||||
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>Next</button>
|
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>Next</button>
|
||||||
@@ -254,7 +254,7 @@ if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m-10 text-center">
|
<div class="m-2 text-center">
|
||||||
Welcome to the NexusPHP updater, if you have any questions, click<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">here</a>for help.
|
Welcome to the NexusPHP updater, if you have any questions, click<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">here</a>for help.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user