Fix #2396 display warning if exec() function is disabled

This commit is contained in:
Kijin Sung 2024-08-21 19:54:59 +09:00
parent a72b4081b6
commit 311a35c955
4 changed files with 6 additions and 0 deletions

View file

@ -224,6 +224,7 @@ class FileAdminView extends File
Context::set('config', $config);
Context::set('is_ffmpeg', function_exists('exec') && !empty($config->ffmpeg_command) && Rhymix\Framework\Storage::isExecutable($config->ffmpeg_command) && !empty($config->ffprobe_command) && Rhymix\Framework\Storage::isExecutable($config->ffprobe_command));
Context::set('is_magick', function_exists('exec') && !empty($config->magick_command) && Rhymix\Framework\Storage::isExecutable($config->magick_command));
Context::set('is_exec_available', function_exists('exec'));
// Set a template file
$this->setTemplatePath($this->module_path.'tpl');

View file

@ -128,6 +128,7 @@ $lang->ffprobe_path = 'Absolute Path to ffprobe';
$lang->magick_path = 'Absolute Path to magick';
$lang->about_ffmpeg_path = 'Rhymix uses ffmpeg to convert video files.';
$lang->about_magick_path = 'Rhymix uses magick to convert newer image formats such as AVIF and HEIC.<br />Note that the \'convert\' command from previous versions of ImageMagick doesn\'t support these formats.<br />The latest version can be downloaded from their <a href="https://imagemagick.org/script/download.php" target="_blank">official site</a>.';
$lang->msg_cannot_use_exec = 'The exec() function is disabled on this server.';
$lang->msg_cannot_use_ffmpeg = 'In order to use this feature, PHP must be able to execute \'ffmpeg\' and \'ffprobe\' commands.';
$lang->msg_cannot_use_exif = 'In order to use this feature, PHP must be installed with the \'exif\' extension.';
$lang->msg_need_magick = 'In order to handle AVIF and HEIC formats, PHP must be able to execute the \'magick\' command from ImageMagick 7.x or higher.';

View file

@ -131,6 +131,7 @@ $lang->ffprobe_path = 'ffprobe 절대경로';
$lang->magick_path = 'magick 절대경로';
$lang->about_ffmpeg_path = '동영상 변환에 사용합니다.';
$lang->about_magick_path = 'AVIF, HEIC 등 일부 이미지 변환에 사용합니다.<br />구 버전 ImageMagick의 convert 명령은 이러한 포맷을 지원하지 않습니다.<br />새 버전은 <a href="https://imagemagick.org/script/download.php" target="_blank">공식 사이트</a>에서 다운받을 수 있습니다.';
$lang->msg_cannot_use_exec = '이 서버에서 exec() 함수를 사용할 수 없습니다.';
$lang->msg_cannot_use_ffmpeg = '이 기능을 사용하려면 PHP에서 ffmpeg 및 ffprobe 명령을 실행할 수 있어야 합니다.';
$lang->msg_cannot_use_exif = '이 기능을 사용하려면 PHP exif 확장모듈이 필요합니다.';
$lang->msg_need_magick = 'AVIF, HEIC 변환을 위해서는 PHP에서 ImageMagick 7.x 이상의 magick 명령을 실행할 수 있어야 합니다.';

View file

@ -253,6 +253,7 @@
<div class="x_controls">
<input type="text" name="ffmpeg_command" value="{$config->ffmpeg_command}" />
<p class="x_help-block">{$lang->about_ffmpeg_path}</p>
<p class="x_text-info" cond="!$is_exec_available">{$lang->msg_cannot_use_exec}</p>
</div>
</div>
<div class="x_control-group">
@ -260,6 +261,7 @@
<div class="x_controls">
<input type="text" name="ffprobe_command" value="{$config->ffprobe_command}" />
<p class="x_help-block">{$lang->about_ffmpeg_path}</p>
<p class="x_text-info" cond="!$is_exec_available">{$lang->msg_cannot_use_exec}</p>
</div>
</div>
<div class="x_control-group">
@ -267,6 +269,7 @@
<div class="x_controls">
<input type="text" name="magick_command" value="{$config->magick_command}" />
<p class="x_help-block">{$lang->about_magick_path}</p>
<p class="x_text-info" cond="!$is_exec_available">{$lang->msg_cannot_use_exec}</p>
</div>
</div>
</section>