Skip to content

Commit

Permalink
Remove PhantomJS references; update composer.json to pull current pac…
Browse files Browse the repository at this point in the history
…kages for PHPPresentation; load helpers
  • Loading branch information
collectiveaccess committed Mar 13, 2022
1 parent 63a0dd1 commit 8f24c10
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 248 deletions.
8 changes: 4 additions & 4 deletions app/conf/app.conf
Expand Up @@ -1635,13 +1635,13 @@ dont_use_graphicsmagick_to_identify_pdfs = 0
#
dont_use_zendpdf_to_identify_pdfs = 1

# CollectiveAccess supports three methods for generating PDF output for download and printing: dompdf (slower; built-in),
# wkhtmltopdf (faster; requires additional software installation) and phantomjs (faster; requires additional software installation).
# By default it will favor using wkhtmltopdf if available, falling back to phantomjs and then to dompdf which is always available.
# CollectiveAccess supports two methods for generating PDF output for download and printing: dompdf (slower; built-in),
# wkhtmltopdf (faster; requires additional software installation) .
# By default it will favor using wkhtmltopdf if available, falling back to dompdf which is always available.
#
# You can override the build in preference and force the use of a specific PDF generator by uncommenting and setting this
# option to one of the following:
# wkhtmltopdf, phantomjs, dompdf
# wkhtmltopdf, dompdf
# use_pdf_renderer = wkhtmltopdf

# Only media than can be identified by a plugin may be uploaded. If you want to be able to upload any file
Expand Down
7 changes: 2 additions & 5 deletions app/conf/external_applications.conf
Expand Up @@ -14,7 +14,7 @@ dcraw_app = /usr/bin/dcraw
imagemagick_path = /usr/bin

# Path to GraphicsMagick binary (http://www.graphicsmagick.org)
graphicsmagick_app = /usr/bin/gm
graphicsmagick_app = /opt/homebrew/bin/gm

# Path to pdftotext binary (part of the xpdf package from http://www.foolabs.com/xpdf/)
pdftotext_app = /usr/bin/pdftotext
Expand All @@ -31,14 +31,11 @@ pdfminer_app = /usr/bin/pdf2txt.py
# Path to ExifTool binary (http://www.sno.phy.queensu.ca/~phil/exiftool/)
exiftool_app = /usr/bin/exiftool

# Path to PhantomJS (http://phantomjs.org)
phantomjs_app = /usr/local/bin/phantomjs

# Path to wkhtmltopdf (http://wkhtmltopdf.org)
wkhtmltopdf_app = /usr/local/bin/wkhtmltopdf

# Path to OpenCTM ctmconv (convert 3d model to CTM format) binary (http://openctm.sourceforge.net)
openctm_app = /usr/local/bin/ctmconv

# Path to Meshlab meshlabserver binary (http://meshlab.sourceforge.net)
meshlabserver_app = /usr/local/bin/meshlabserver
meshlabserver_app = /usr/local/bin/meshlabserver
1 change: 1 addition & 0 deletions app/helpers/preload.php
Expand Up @@ -45,6 +45,7 @@
require_once(__CA_LIB_DIR__."/Zend/Registry.php");

require_once(__CA_LIB_DIR__."/Utils/Debug.php");
require_once(__CA_APP_DIR__."/helpers/systemHelpers.php");
require_once(__CA_APP_DIR__."/helpers/utilityHelpers.php");
require_once(__CA_APP_DIR__."/helpers/requestHelpers.php");
require_once(__CA_APP_DIR__."/helpers/initializeLocale.php");
Expand Down
3 changes: 1 addition & 2 deletions app/helpers/printHelpers.php
Expand Up @@ -472,9 +472,8 @@ function caPrintLabels($po_view, $po_result, $ps_title) {
$vn_left = $vn_left_margin;

switch($vs_renderer) {
case 'PhantomJS':
case 'wkhtmltopdf':
// WebKit based renderers (PhantomJS, wkhtmltopdf) want things numbered relative to the top of the document (Eg. the upper left hand corner of the first page is 0,0, the second page is 0,792, Etc.)
// WebKit based renderers (wkhtmltopdf) want things numbered relative to the top of the document (Eg. the upper left hand corner of the first page is 0,0, the second page is 0,792, Etc.)
$vn_page_count++;
$vn_top = ($vn_page_count * $vn_page_height) + $vn_top_margin;
break;
Expand Down
183 changes: 0 additions & 183 deletions app/lib/Plugins/PDFRenderer/PhantomJS.php

This file was deleted.

7 changes: 2 additions & 5 deletions app/lib/Plugins/PDFRenderer/domPDF.php
Expand Up @@ -131,17 +131,14 @@ public function setPage($ps_size, $ps_orientation, $ps_margin_top=0, $ps_margin_
public function checkStatus() {
$va_status = parent::checkStatus();

if (!($vb_phantom_js = caPhantomJSInstalled()) && !($vb_wkhtmltopdf = caWkhtmltopdfInstalled())) {
if (!($vb_wkhtmltopdf = caWkhtmltopdfInstalled())) {
$va_status['available'] = true;
} else {
$va_status['available'] = false;
if ($vb_wkhtmltopdf) {
$va_status['unused'] = true;
$va_status['warnings'][] = _t("Didn't load because wkhtmltopdf is available and preferred");
} elseif($vb_phantom_js) {
$va_status['unused'] = true;
$va_status['warnings'][] = _t("Didn't load because PhantomJS is available and preferred");
}
}
}

return $va_status;
Expand Down
48 changes: 0 additions & 48 deletions app/lib/Print/phantomjs/rasterise.js

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -11,7 +11,7 @@
"hoa/compiler": "~3.17",
"hoa/visitor": "~2.17",
"collectiveaccess/service-wrapper": "v1.1.1",
"phpoffice/phppresentation": "dev-master",
"phpoffice/phppresentation": "v0.9.*",
"phpoffice/phpword": "v0.15.*",
"phpoffice/phpexcel": "v1.8.1",
"tedivm/stash": "0.14.*",
Expand Down

0 comments on commit 8f24c10

Please sign in to comment.