mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #57988
[Bug 1871515] [NEW] pdfunite and ghostscript availability check for RHEL/CentOS
Public bug reported:
Adding the following code, we can check pdfunite and ghostscript
installation on Red Hat Enterprise Linux (RHEL) and CentOS environment.
File to modify:
export/pdf/lib.php
Line:
80
[Before]
public static function has_pdf_combiner() {
// Check we have a valid way to combine pdfs
$combiner = false;
if ($pdfunite = exec('apt-cache policy poppler-utils | grep Installed')) {
if (!preg_match('/Installed\: \(none\)/', $pdfunite)) {
$combiner = 'pdfunite';
}
}
if ($ghostscript = exec('apt-cache policy ghostscript | grep Installed')) {
if (!preg_match('/Installed\: \(none\)/', $ghostscript)) {
$combiner = 'ghostscript';
}
}
return $combiner;
}
[After]
public static function has_pdf_combiner() {
// Check we have a valid way to combine pdfs
$combiner = false;
if ($pdfunite = exec('apt-cache policy poppler-utils | grep Installed')) {
if (!preg_match('/Installed\: \(none\)/', $pdfunite)) {
$combiner = 'pdfunite';
}
}
if ($ghostscript = exec('apt-cache policy ghostscript | grep Installed')) {
if (!preg_match('/Installed\: \(none\)/', $ghostscript)) {
$combiner = 'ghostscript';
}
}
if ($pgtune = exec('rpm -q poppler-utils')) {
$combiner = 'pdfunite';
}
if ($pgtune = exec('rpm -q ghostscript')) {
$combiner = 'ghostscript';
}
return $combiner;
}
** Affects: mahara
Importance: Medium
Status: New
** Tags: export
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1871515
Title:
pdfunite and ghostscript availability check for RHEL/CentOS
Status in Mahara:
New
Bug description:
Adding the following code, we can check pdfunite and ghostscript
installation on Red Hat Enterprise Linux (RHEL) and CentOS
environment.
File to modify:
export/pdf/lib.php
Line:
80
[Before]
public static function has_pdf_combiner() {
// Check we have a valid way to combine pdfs
$combiner = false;
if ($pdfunite = exec('apt-cache policy poppler-utils | grep Installed')) {
if (!preg_match('/Installed\: \(none\)/', $pdfunite)) {
$combiner = 'pdfunite';
}
}
if ($ghostscript = exec('apt-cache policy ghostscript | grep Installed')) {
if (!preg_match('/Installed\: \(none\)/', $ghostscript)) {
$combiner = 'ghostscript';
}
}
return $combiner;
}
[After]
public static function has_pdf_combiner() {
// Check we have a valid way to combine pdfs
$combiner = false;
if ($pdfunite = exec('apt-cache policy poppler-utils | grep Installed')) {
if (!preg_match('/Installed\: \(none\)/', $pdfunite)) {
$combiner = 'pdfunite';
}
}
if ($ghostscript = exec('apt-cache policy ghostscript | grep Installed')) {
if (!preg_match('/Installed\: \(none\)/', $ghostscript)) {
$combiner = 'ghostscript';
}
}
if ($pgtune = exec('rpm -q poppler-utils')) {
$combiner = 'pdfunite';
}
if ($pgtune = exec('rpm -q ghostscript')) {
$combiner = 'ghostscript';
}
return $combiner;
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1871515/+subscriptions
Follow ups