Update Installer.php

This commit is contained in:
Shlee 2022-06-19 15:31:55 +09:30 committed by GitHub
parent 211b497240
commit dcd7a35384
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 7 deletions

View File

@ -68,7 +68,8 @@ class Installer extends Command
if($this->installType === 'Advanced') { if($this->installType === 'Advanced') {
$this->info('Installer: Advanced...'); $this->info('Installer: Advanced...');
$this->checkPHPDependencies(); $this->checkPHPRequiredDependencies();
$this->checkPHPOptionalDependencies();
$this->checkFFmpegDependencies(); $this->checkFFmpegDependencies();
$this->checkOptimiseDependencies(); $this->checkOptimiseDependencies();
$this->checkDiskPermissions(); $this->checkDiskPermissions();
@ -127,7 +128,7 @@ class Installer extends Command
$this->installType = $type; $this->installType = $type;
} }
protected function checkPHPDependencies() protected function checkPHPRequiredDependencies()
{ {
$this->line(' '); $this->line(' ');
$this->info('Checking for required php extensions...'); $this->info('Checking for required php extensions...');
@ -139,6 +140,23 @@ class Installer extends Command
'json', 'json',
'mbstring', 'mbstring',
'openssl', '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', 'gd',
'intl', 'intl',
'xml', 'xml',
@ -148,11 +166,11 @@ class Installer extends Command
foreach($extensions as $ext) { foreach($extensions as $ext) {
if(extension_loaded($ext) == false) { if(extension_loaded($ext) == false) {
$this->error("- \"{$ext}\" PHP extension not found, aborting installation"); $this->error("- \"{$ext}\" Optional PHP extension not found");
exit; } else {
$this->info ("- \"{$dep}\" Optional PHP extension found");
} }
} }
$this->info("- Required PHP extensions found!");
} }
protected function checkFFmpegDependencies() protected function checkFFmpegDependencies()