From 1e1e7ef1353cc4461b101813885d6526df30de78 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 19 Jan 2024 11:36:17 +1100 Subject: [PATCH] Centralise configuration of Shellbox /bin/sh location Use $wgShellboxShell, introduced for this purpose in If41a2baada2e4e2462518c1f437af458feb29632. Change-Id: Ic35598f26a868624a8b2e37ab064a6c0c27e392f --- extension.json | 5 +---- includes/PdfImage.php | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/extension.json b/extension.json index 6181629..dea23be 100644 --- a/extension.json +++ b/extension.json @@ -9,7 +9,7 @@ "license-name": "GPL-2.0-or-later", "type": "media", "requires": { - "MediaWiki": ">= 1.41" + "MediaWiki": ">= 1.42" }, "config": { "PdfOutputExtension": { @@ -32,9 +32,6 @@ }, "PdfInfo": { "value": "/usr/bin/pdfinfo" - }, - "PdfHandlerShell": { - "value": "/bin/sh" } }, "MessagesDirs": { diff --git a/includes/PdfImage.php b/includes/PdfImage.php index 1b98e20..a9e5bcf 100644 --- a/includes/PdfImage.php +++ b/includes/PdfImage.php @@ -104,7 +104,7 @@ class PdfImage { * @return array */ public function retrieveMetaData(): array { - global $wgPdfInfo, $wgPdftoText, $wgPdfHandlerShell; + global $wgPdfInfo, $wgPdftoText, $wgShellboxShell; $command = MediaWikiServices::getInstance()->getShellCommandFactory() ->createBoxed( 'pdfhandler' ) @@ -113,7 +113,7 @@ class PdfImage { ->routeName( 'pdfhandler-metadata' ); $result = $command - ->params( $wgPdfHandlerShell, 'scripts/retrieveMetaData.sh' ) + ->params( $wgShellboxShell, 'scripts/retrieveMetaData.sh' ) ->inputFileFromFile( 'scripts/retrieveMetaData.sh', __DIR__ . '/../scripts/retrieveMetaData.sh' )