PHP check lists all PHP modules + linted

This commit is contained in:
Shlee 2022-06-25 12:03:00 +09:30 committed by GitHub
parent 13a86ab2b5
commit e0307babf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,7 +69,6 @@ class Installer extends Command
if ($this->installType === 'Advanced') {
$this->info('Installer: Advanced...');
$this->checkPHPRequiredDependencies();
$this->checkPHPOptionalDependencies();
$this->checkFFmpegDependencies();
$this->checkOptimiseDependencies();
$this->checkDiskPermissions();
@ -140,23 +139,6 @@ class Installer extends Command
'json',
'mbstring',
'openssl',
];
foreach($extensions as $ext) {
if(extension_loaded($ext) == false) {
$this->error("- \"{$ext}\" Required PHP Extension not found, aborting installation");
exit;
}
}
$this->info("- Required PHP extensions found!");
}
protected function checkPHPOptionalDependencies()
{
$this->line(' ');
$this->info('Checking For Optional PHP Extensions...');
$extensions = [
'gd',
'intl',
'xml',
@ -171,6 +153,13 @@ class Installer extends Command
$this->info("- \"{$ext}\" PHP extension found");
}
}
$continue = $this->choice('Do you wish to continue?', ['no', 'yes'], 0);
if ($this->continue === 'no') {
$this->info('Exiting Installer.');
exit;
}
}
protected function checkFFmpegDependencies()
@ -217,7 +206,7 @@ class Installer extends Command
$paths = [
base_path('bootstrap'),
base_path('storage')
base_path('storage'),
];
foreach ($paths as $path) {
@ -282,7 +271,6 @@ class Installer extends Command
$redis_password = $this->ask('Set redis password', 'null');
$redis_port = $this->ask('Set redis port', 6379);
$this->updateEnvFile('REDIS_CLIENT', $redis_client);
$this->updateEnvFile('REDIS_SCHEME', 'tcp');
$this->updateEnvFile('REDIS_HOST', $redis_host);
@ -502,13 +490,13 @@ class Installer extends Command
fclose($file);
}
protected function parseSize($size) {
protected function parseSize($size)
{
$unit = preg_replace('/[^bkmgtpezy]/i', '', $size);
$size = preg_replace('/[^0-9\.]/', '', $size);
if ($unit) {
return round($size * pow(1024, stripos('bkmgtpezy', $unit[0])));
}
else {
} else {
return round($size);
}
}