mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-07 10:04:27 +00:00
PHRAS-4067: admin - dashboard - 500 error (#4513)
* fix error 500 on dashboard : remove unused swiftools requirement * unused * patch on 4.1.8
This commit is contained in:
@@ -96,9 +96,6 @@ main:
|
|||||||
binaries:
|
binaries:
|
||||||
ghostscript_binary: null
|
ghostscript_binary: null
|
||||||
php_binary: null
|
php_binary: null
|
||||||
swf_extract_binary: null
|
|
||||||
pdf2swf_binary: null
|
|
||||||
swf_render_binary: null
|
|
||||||
unoconv_binary: null
|
unoconv_binary: null
|
||||||
ffmpeg_binary: null
|
ffmpeg_binary: null
|
||||||
ffprobe_binary: null
|
ffprobe_binary: null
|
||||||
|
@@ -6,9 +6,6 @@ echo `date +"%Y-%m-%d %H:%M:%S"` - "update binaries path in accordance of docker
|
|||||||
|
|
||||||
bin/setup system:config -s set main.binaries.php_binary "/usr/local/bin/php"
|
bin/setup system:config -s set main.binaries.php_binary "/usr/local/bin/php"
|
||||||
bin/setup system:config -s set main.binaries.ghostscript_binary "/usr/bin/gs"
|
bin/setup system:config -s set main.binaries.ghostscript_binary "/usr/bin/gs"
|
||||||
bin/setup system:config -s set main.binaries.swf_extract_binary "/usr/bin/swfextract"
|
|
||||||
bin/setup system:config -s set main.binaries.pdf2swf_binary null
|
|
||||||
bin/setup system:config -s set main.binaries.swf_render_binary "/usr/bin/swfrender"
|
|
||||||
bin/setup system:config -s set main.binaries.unoconv_binary "/usr/bin/unoconv"
|
bin/setup system:config -s set main.binaries.unoconv_binary "/usr/bin/unoconv"
|
||||||
bin/setup system:config -s set main.binaries.ffmpeg_binary "/usr/local/bin/ffmpeg"
|
bin/setup system:config -s set main.binaries.ffmpeg_binary "/usr/local/bin/ffmpeg"
|
||||||
bin/setup system:config -s set main.binaries.ffprobe_binary "/usr/local/bin/ffprobe"
|
bin/setup system:config -s set main.binaries.ffprobe_binary "/usr/local/bin/ffprobe"
|
||||||
|
@@ -429,9 +429,6 @@ class Install extends Command
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'php_binary' => $this->executableFinder->find('php'),
|
'php_binary' => $this->executableFinder->find('php'),
|
||||||
'pdf2swf_binary' => $this->executableFinder->find('pdf2swf'),
|
|
||||||
'swf_extract_binary' => $this->executableFinder->find('swfextract'),
|
|
||||||
'swf_render_binary' => $this->executableFinder->find('swfrender'),
|
|
||||||
'unoconv_binary' => $this->executableFinder->find('unoconv'),
|
'unoconv_binary' => $this->executableFinder->find('unoconv'),
|
||||||
'ffmpeg_binary' => $this->executableFinder->find('ffmpeg', $this->executableFinder->find('avconv')),
|
'ffmpeg_binary' => $this->executableFinder->find('ffmpeg', $this->executableFinder->find('avconv')),
|
||||||
'ffprobe_binary' => $this->executableFinder->find('ffprobe', $this->executableFinder->find('avprobe')),
|
'ffprobe_binary' => $this->executableFinder->find('ffprobe', $this->executableFinder->find('avprobe')),
|
||||||
|
@@ -379,9 +379,6 @@ class V1Controller extends Controller
|
|||||||
'binary' => [
|
'binary' => [
|
||||||
'phpCli' => isset($binaries['php_binary']) ? $binaries['php_binary'] : null,
|
'phpCli' => isset($binaries['php_binary']) ? $binaries['php_binary'] : null,
|
||||||
'phpIni' => $conf->get(['registry', 'executables', 'php-conf-path']),
|
'phpIni' => $conf->get(['registry', 'executables', 'php-conf-path']),
|
||||||
'swfExtract' => isset($binaries['swf_extract_binary']) ? $binaries['swf_extract_binary'] : null,
|
|
||||||
'pdf2swf' => isset($binaries['pdf2swf_binary']) ? $binaries['pdf2swf_binary'] : null,
|
|
||||||
'swfRender' => isset($binaries['swf_render_binary']) ? $binaries['swf_render_binary'] : null,
|
|
||||||
'unoconv' => isset($binaries['unoconv_binary']) ? $binaries['unoconv_binary'] : null,
|
'unoconv' => isset($binaries['unoconv_binary']) ? $binaries['unoconv_binary'] : null,
|
||||||
'ffmpeg' => isset($binaries['ffmpeg_binary']) ? $binaries['ffmpeg_binary'] : null,
|
'ffmpeg' => isset($binaries['ffmpeg_binary']) ? $binaries['ffmpeg_binary'] : null,
|
||||||
'ffprobe' => isset($binaries['ffprobe_binary']) ? $binaries['ffprobe_binary'] : null,
|
'ffprobe' => isset($binaries['ffprobe_binary']) ? $binaries['ffprobe_binary'] : null,
|
||||||
|
@@ -184,9 +184,6 @@ class SetupController extends Controller
|
|||||||
$binaryData = [];
|
$binaryData = [];
|
||||||
foreach ([
|
foreach ([
|
||||||
'php_binary' => $request->request->get('binary_php'),
|
'php_binary' => $request->request->get('binary_php'),
|
||||||
'swf_extract_binary' => $request->request->get('binary_swfextract'),
|
|
||||||
'pdf2swf_binary' => $request->request->get('binary_pdf2swf'),
|
|
||||||
'swf_render_binary' => $request->request->get('binary_swfrender'),
|
|
||||||
'unoconv_binary' => $request->request->get('binary_unoconv'),
|
'unoconv_binary' => $request->request->get('binary_unoconv'),
|
||||||
'ffmpeg_binary' => $request->request->get('binary_ffmpeg'),
|
'ffmpeg_binary' => $request->request->get('binary_ffmpeg'),
|
||||||
'mp4box_binary' => $request->request->get('binary_MP4Box'),
|
'mp4box_binary' => $request->request->get('binary_MP4Box'),
|
||||||
|
@@ -13,9 +13,6 @@ class MediaAlchemystServiceProvider implements ServiceProviderInterface
|
|||||||
$app['media-alchemyst.configuration'] = $app->share(function (Application $app) {
|
$app['media-alchemyst.configuration'] = $app->share(function (Application $app) {
|
||||||
$configuration = [];
|
$configuration = [];
|
||||||
$parameters = [
|
$parameters = [
|
||||||
'swftools.pdf2swf.binaries' => 'pdf2swf_binary',
|
|
||||||
'swftools.swfrender.binaries' => 'swf_render_binary',
|
|
||||||
'swftools.swfextract.binaries' => 'swf_extract_binary',
|
|
||||||
'unoconv.binaries' => 'unoconv_binary',
|
'unoconv.binaries' => 'unoconv_binary',
|
||||||
'mp4box.binaries' => 'mp4box_binary',
|
'mp4box.binaries' => 'mp4box_binary',
|
||||||
'gs.binaries' => 'ghostscript_binary',
|
'gs.binaries' => 'ghostscript_binary',
|
||||||
|
@@ -20,10 +20,7 @@ class BinariesProbe extends BinariesRequirements implements ProbeInterface
|
|||||||
{
|
{
|
||||||
parent::__construct(array_filter([
|
parent::__construct(array_filter([
|
||||||
'php_binary' => isset($binaries['php_binary']) ? $binaries['php_binary'] : null,
|
'php_binary' => isset($binaries['php_binary']) ? $binaries['php_binary'] : null,
|
||||||
'pdf2swf_binary' => isset($binaries['pdf2swf_binary']) ? $binaries['pdf2swf_binary'] : null,
|
|
||||||
'unoconv_binary' => isset($binaries['unoconv_binary']) ? $binaries['unoconv_binary'] : null,
|
'unoconv_binary' => isset($binaries['unoconv_binary']) ? $binaries['unoconv_binary'] : null,
|
||||||
'swf_extract_binary' => isset($binaries['swf_extract_binary']) ? $binaries['swf_extract_binary'] : null,
|
|
||||||
'swf_render_binary' => isset($binaries['swf_render_binary']) ? $binaries['swf_render_binary'] : null,
|
|
||||||
'mp4box_binary' => isset($binaries['mp4box_binary']) ? $binaries['mp4box_binary'] : null,
|
'mp4box_binary' => isset($binaries['mp4box_binary']) ? $binaries['mp4box_binary'] : null,
|
||||||
'pdftotext_binary' => isset($binaries['pdftotext_binary']) ? $binaries['pdftotext_binary'] : null,
|
'pdftotext_binary' => isset($binaries['pdftotext_binary']) ? $binaries['pdftotext_binary'] : null,
|
||||||
'ffmpeg_binary' => isset($binaries['ffmpeg_binary']) ? $binaries['ffmpeg_binary'] : null,
|
'ffmpeg_binary' => isset($binaries['ffmpeg_binary']) ? $binaries['ffmpeg_binary'] : null,
|
||||||
|
@@ -19,7 +19,6 @@ class BinariesRequirements extends RequirementCollection implements RequirementI
|
|||||||
{
|
{
|
||||||
const FILE_VERSION = '5.04';
|
const FILE_VERSION = '5.04';
|
||||||
const IMAGICK_VERSION = '6.2.9';
|
const IMAGICK_VERSION = '6.2.9';
|
||||||
const SWFTOOLS_VERSION = '0.9.0';
|
|
||||||
const UNOCONV_VERSION = '0.5';
|
const UNOCONV_VERSION = '0.5';
|
||||||
const MP4BOX_VERSION = '0.4.0';
|
const MP4BOX_VERSION = '0.4.0';
|
||||||
const EXIFTOOL_VERSION = '9.15';
|
const EXIFTOOL_VERSION = '9.15';
|
||||||
@@ -79,21 +78,6 @@ class BinariesRequirements extends RequirementCollection implements RequirementI
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf2swf = isset($binaries['pdf2swf_binary']) ? $binaries['pdf2swf_binary'] : $finder->find('pdf2swf');
|
|
||||||
|
|
||||||
if (null !== $pdf2swf) {
|
|
||||||
$output = null;
|
|
||||||
exec($pdf2swf . ' --version', $output);
|
|
||||||
$data = sscanf($output[0], 'pdf2swf - part of swftools %d.%d.%d');
|
|
||||||
$version = sprintf('%d.%d.%d', $data[0], $data[1], $data[2]);
|
|
||||||
|
|
||||||
$this->addRecommendation(
|
|
||||||
version_compare(static::SWFTOOLS_VERSION, $version, '<='),
|
|
||||||
sprintf('SWFTools (pdf2swf) version %s or higher is required (%s provided)', static::SWFTOOLS_VERSION, $version),
|
|
||||||
'Please update to a more recent version.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$unoconv = isset($binaries['unoconv_binary']) ? $binaries['unoconv_binary'] : $finder->find('unoconv');
|
$unoconv = isset($binaries['unoconv_binary']) ? $binaries['unoconv_binary'] : $finder->find('unoconv');
|
||||||
|
|
||||||
$this->addRecommendation(
|
$this->addRecommendation(
|
||||||
@@ -115,48 +99,6 @@ class BinariesRequirements extends RequirementCollection implements RequirementI
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$swfextract = isset($binaries['swf_extract_binary']) ? $binaries['swf_extract_binary'] : $finder->find('swfextract');
|
|
||||||
|
|
||||||
$this->addRecommendation(
|
|
||||||
null !== $swfextract && is_executable($swfextract),
|
|
||||||
'SWFTools (swfextract) are required for flash files support',
|
|
||||||
'Please install SWFTools (http://www.swftools.org/)'
|
|
||||||
);
|
|
||||||
|
|
||||||
if (null !== $swfextract) {
|
|
||||||
$output = null;
|
|
||||||
exec($swfextract . ' --version', $output);
|
|
||||||
$data = sscanf($output[0], 'swfextract - part of swftools %d.%d.%d');
|
|
||||||
$version = sprintf('%d.%d.%d', $data[0], $data[1], $data[2]);
|
|
||||||
|
|
||||||
$this->addRecommendation(
|
|
||||||
version_compare(static::SWFTOOLS_VERSION, $version, '<='),
|
|
||||||
sprintf('SWFTools (swfextract) version %s or higher is required (%s provided)', static::SWFTOOLS_VERSION, $version),
|
|
||||||
'Please update to a more recent version.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$swfrender = isset($binaries['swf_render_binary']) ? $binaries['swf_render_binary'] : $finder->find('swfrender');
|
|
||||||
|
|
||||||
$this->addRecommendation(
|
|
||||||
null !== $swfrender && is_executable($swfrender),
|
|
||||||
'SWFTools (swfrender) are required for flash files support',
|
|
||||||
'Please install SWFTools (http://www.swftools.org/)'
|
|
||||||
);
|
|
||||||
|
|
||||||
if (null !== $swfrender) {
|
|
||||||
$output = null;
|
|
||||||
exec($swfrender . ' --version', $output);
|
|
||||||
$data = sscanf($output[0], 'swfrender - part of swftools %d.%d.%d');
|
|
||||||
$version = sprintf('%d.%d.%d', $data[0], $data[1], $data[2]);
|
|
||||||
|
|
||||||
$this->addRecommendation(
|
|
||||||
version_compare(static::SWFTOOLS_VERSION, $version, '<='),
|
|
||||||
sprintf('SWFTools (swfrender) version %s or higher is required (%s provided)', static::SWFTOOLS_VERSION, $version),
|
|
||||||
'Please update to a more recent version.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$mp4box = isset($binaries['mp4box_binary']) ? $binaries['mp4box_binary'] : $finder->find('MP4Box');
|
$mp4box = isset($binaries['mp4box_binary']) ? $binaries['mp4box_binary'] : $finder->find('MP4Box');
|
||||||
|
|
||||||
$this->addRecommendation(
|
$this->addRecommendation(
|
||||||
|
73
lib/classes/patch/418PHRAS4067.php
Normal file
73
lib/classes/patch/418PHRAS4067.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Application;
|
||||||
|
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||||
|
|
||||||
|
class patch_418PHRAS4067 implements patchInterface
|
||||||
|
{
|
||||||
|
/** @var string */
|
||||||
|
private $release = '4.1.8';
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
private $concern = [base::APPLICATION_BOX];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function get_release()
|
||||||
|
{
|
||||||
|
return $this->release;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function require_all_upgrades()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function concern()
|
||||||
|
{
|
||||||
|
return $this->concern;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function apply(base $base, Application $app)
|
||||||
|
{
|
||||||
|
if ($base->get_base_type() === base::DATA_BOX) {
|
||||||
|
$this->patch_databox($base, $app);
|
||||||
|
} elseif ($base->get_base_type() === base::APPLICATION_BOX) {
|
||||||
|
$this->patch_appbox($base, $app);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function patch_databox(databox $databox, Application $app)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private function patch_appbox(base $appbox, Application $app)
|
||||||
|
{
|
||||||
|
/** @var PropertyAccess $conf */
|
||||||
|
$conf = $app['conf'];
|
||||||
|
|
||||||
|
$conf->remove(['main', 'binaries', 'pdf2swf_binary']);
|
||||||
|
$conf->remove(['main', 'binaries', 'swf_render_binary']);
|
||||||
|
$conf->remove(['main', 'binaries', 'swf_extract_binary']);
|
||||||
|
}
|
||||||
|
}
|
@@ -89,9 +89,6 @@ main:
|
|||||||
binaries:
|
binaries:
|
||||||
ghostscript_binary: null
|
ghostscript_binary: null
|
||||||
php_binary: null
|
php_binary: null
|
||||||
swf_extract_binary: null
|
|
||||||
pdf2swf_binary: null
|
|
||||||
swf_render_binary: null
|
|
||||||
unoconv_binary: null
|
unoconv_binary: null
|
||||||
ffmpeg_binary: null
|
ffmpeg_binary: null
|
||||||
ffprobe_binary: null
|
ffprobe_binary: null
|
||||||
|
@@ -46,9 +46,6 @@ dbname: '{{ mariadb.appbox_db }}'
|
|||||||
binaries:
|
binaries:
|
||||||
ghostscript_binary: null
|
ghostscript_binary: null
|
||||||
php_binary: null
|
php_binary: null
|
||||||
swf_extract_binary: null
|
|
||||||
pdf2swf_binary: null
|
|
||||||
swf_render_binary: null
|
|
||||||
unoconv_binary: null
|
unoconv_binary: null
|
||||||
ffmpeg_binary: null
|
ffmpeg_binary: null
|
||||||
ffprobe_binary: null
|
ffprobe_binary: null
|
||||||
|
@@ -52,9 +52,6 @@ main:
|
|||||||
binaries:
|
binaries:
|
||||||
ghostscript_binary: null
|
ghostscript_binary: null
|
||||||
php_binary: null
|
php_binary: null
|
||||||
swf_extract_binary: null
|
|
||||||
pdf2swf_binary: null
|
|
||||||
swf_render_binary: null
|
|
||||||
unoconv_binary: null
|
unoconv_binary: null
|
||||||
ffmpeg_binary: null
|
ffmpeg_binary: null
|
||||||
ffprobe_binary: null
|
ffprobe_binary: null
|
||||||
|
@@ -46,9 +46,6 @@ main:
|
|||||||
binaries:
|
binaries:
|
||||||
ghostscript_binary: null
|
ghostscript_binary: null
|
||||||
php_binary: null
|
php_binary: null
|
||||||
swf_extract_binary: null
|
|
||||||
pdf2swf_binary: null
|
|
||||||
swf_render_binary: null
|
|
||||||
unoconv_binary: null
|
unoconv_binary: null
|
||||||
ffmpeg_binary: null
|
ffmpeg_binary: null
|
||||||
ffprobe_binary: null
|
ffprobe_binary: null
|
||||||
|
@@ -59,9 +59,6 @@ main:
|
|||||||
binaries:
|
binaries:
|
||||||
ghostscript_binary: null
|
ghostscript_binary: null
|
||||||
php_binary: null
|
php_binary: null
|
||||||
swf_extract_binary: null
|
|
||||||
pdf2swf_binary: null
|
|
||||||
swf_render_binary: null
|
|
||||||
unoconv_binary: null
|
unoconv_binary: null
|
||||||
ffmpeg_binary: null
|
ffmpeg_binary: null
|
||||||
ffprobe_binary: null
|
ffprobe_binary: null
|
||||||
|
@@ -46,9 +46,6 @@ main:
|
|||||||
binaries:
|
binaries:
|
||||||
ghostscript_binary: null
|
ghostscript_binary: null
|
||||||
php_binary: null
|
php_binary: null
|
||||||
swf_extract_binary: null
|
|
||||||
pdf2swf_binary: null
|
|
||||||
swf_render_binary: null
|
|
||||||
unoconv_binary: null
|
unoconv_binary: null
|
||||||
ffmpeg_binary: null
|
ffmpeg_binary: null
|
||||||
ffprobe_binary: null
|
ffprobe_binary: null
|
||||||
|
Reference in New Issue
Block a user