mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-27 14:17:23 +08:00
update include update env file
This commit is contained in:
@@ -13,7 +13,7 @@ class Install
|
||||
{
|
||||
protected $currentStep;
|
||||
|
||||
protected $minimumPhpVersion = '8.0.3';
|
||||
protected $minimumPhpVersion = '8.2.0';
|
||||
|
||||
protected $progressKeyPrefix = '__step';
|
||||
|
||||
@@ -32,7 +32,10 @@ class Install
|
||||
'UID_STARTS',
|
||||
];
|
||||
|
||||
protected array $requiredExtensions = ['ctype', 'curl', 'fileinfo', 'json', 'mbstring', 'openssl', 'pdo_mysql', 'tokenizer', 'xml', 'mysqli', 'bcmath', 'redis', 'gd', 'gmp', 'Zend OPcache', 'pcntl', 'posix', 'sockets'];
|
||||
protected array $requiredExtensions = [
|
||||
'ctype', 'curl', 'fileinfo', 'json', 'mbstring', 'openssl', 'pdo_mysql', 'tokenizer', 'xml',
|
||||
'mysqli', 'bcmath', 'redis', 'gd', 'gmp', 'Zend OPcache', 'pcntl', 'posix', 'sockets', 'zip', 'intl'
|
||||
];
|
||||
protected array $optionalExtensions = [
|
||||
// ['name' => 'swoole', 'desc' => "If use swoole for Octane, make sure 'current' shows 1"],
|
||||
];
|
||||
|
||||
@@ -536,6 +536,29 @@ class Update extends Install
|
||||
return false;
|
||||
}
|
||||
|
||||
public function updateEnvFile()
|
||||
{
|
||||
$envFile = ROOT_PATH . '.env';
|
||||
$envExample = ROOT_PATH . '.env.example';
|
||||
$envData = readEnvFile($envFile);
|
||||
$envExampleData = readEnvFile($envExample);
|
||||
foreach ($envExampleData as $key => $value) {
|
||||
if (!isset($envData[$key])) {
|
||||
$envData[$key] = $value;
|
||||
}
|
||||
}
|
||||
$fp = @fopen($envFile, 'w');
|
||||
if ($fp === false) {
|
||||
throw new \RuntimeException("can't create env file, make sure php has permission to create file at: " . ROOT_PATH);
|
||||
}
|
||||
$content = "";
|
||||
foreach ($envData as $key => $value) {
|
||||
$content .= "{$key}={$value}\n";
|
||||
}
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ if ($currentStep == 4) {
|
||||
$tableRows = $settingTableRows['table_rows'];
|
||||
$pass = $settingTableRows['pass'];
|
||||
$mysqlInfo = $update->getMysqlVersionInfo();
|
||||
$redisInfo = $update->getREdisVersionInfo();
|
||||
$redisInfo = $update->getRedisVersionInfo();
|
||||
while ($isPost) {
|
||||
set_time_limit(300);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user