From e77400b62185912fd70a9e2ed6b27108d36c3d9c Mon Sep 17 00:00:00 2001 From: Shlee Date: Sun, 19 Jun 2022 14:58:33 +0930 Subject: [PATCH] Update Installer.php --- app/Console/Commands/Installer.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/Installer.php b/app/Console/Commands/Installer.php index ea939b89..738cd528 100644 --- a/app/Console/Commands/Installer.php +++ b/app/Console/Commands/Installer.php @@ -70,6 +70,7 @@ class Installer extends Command $this->info('Installer: Advanced...'); $this->checkPHPDependencies(); $this->checkFFmpegDependencies(); + $this->checkOptimiseDependencies(); $this->checkDiskPermissions(); $this->envProd(); $this->instanceDB(); @@ -141,7 +142,7 @@ class Installer extends Command ]; foreach($extensions as $ext) { if(extension_loaded($ext) == false) { - $this->error("\"{$ext}\" PHP extension not found, aborting installation"); + $this->error("- \"{$ext}\" PHP extension not found, aborting installation"); exit; } } @@ -155,13 +156,35 @@ class Installer extends Command $ffmpeg = exec('which ffmpeg'); if(empty($ffmpeg)) { - $this->error("\"{$ext}\" FFmpeg not found, aborting installation"); + $this->error("- \"{$ext}\" FFmpeg not found, aborting installation"); exit; } else { $this->info('- Found FFmpeg!'); } } + protected function checkOptimiseDependencies() + { + $this->line(' '); + $this->info('Checking for optional FFmpeg dependencies...'); + + $dependencies = [ + 'jpegoptim', + 'optipng', + 'pngquant', + 'gifsicle', + ]; + + foreach($dependencies as $dep) { + $which = exec("which $dep"); + if(empty($which)) { + $this->error("- \"{$dep}\" not found"); + } else { + $this->info ("- \"{$dep}\" found"); + } + } + } + protected function checkDiskPermissions() { $this->line('');