1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-26 09:46:49 +00:00

Update Installer.php

This commit is contained in:
Shlee 2022-06-19 14:58:33 +09:30 committed by GitHub
parent 4da076c756
commit e77400b621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,6 +70,7 @@ class Installer extends Command
$this->info('Installer: Advanced...'); $this->info('Installer: Advanced...');
$this->checkPHPDependencies(); $this->checkPHPDependencies();
$this->checkFFmpegDependencies(); $this->checkFFmpegDependencies();
$this->checkOptimiseDependencies();
$this->checkDiskPermissions(); $this->checkDiskPermissions();
$this->envProd(); $this->envProd();
$this->instanceDB(); $this->instanceDB();
@ -141,7 +142,7 @@ 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}\" PHP extension not found, aborting installation");
exit; exit;
} }
} }
@ -155,13 +156,35 @@ class Installer extends Command
$ffmpeg = exec('which ffmpeg'); $ffmpeg = exec('which ffmpeg');
if(empty($ffmpeg)) { if(empty($ffmpeg)) {
$this->error("\"{$ext}\" FFmpeg not found, aborting installation"); $this->error("- \"{$ext}\" FFmpeg not found, aborting installation");
exit; exit;
} else { } else {
$this->info('- Found FFmpeg!'); $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() protected function checkDiskPermissions()
{ {
$this->line(''); $this->line('');