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

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to