Commit 48057aed authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1914298: pdfexport fetch fails due to path changes



Change-Id: Id400b17fed284a3c5833d163717074b75189b178
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit cb6e4b1c)
parent f3a3b3a0
......@@ -106,10 +106,10 @@ ifdef pdfexportfile
@echo "PDF export files already exists - doing nothing"
else
@echo "Pulling Headless-chromium-php from download ..."
@curl -sSL https://github.com/chrome-php/headless-chromium-php/archive/master.zip -o pdf_tmp.zip && unzip pdf_tmp.zip -d htdocs/lib/chrome-php && rm pdf_tmp.zip
@php external/composer.phar --working-dir=htdocs/lib/chrome-php/headless-chromium-php-master install
@find htdocs/lib/chrome-php/headless-chromium-php-master -type f -name composer.json -delete
@find htdocs/lib/chrome-php/headless-chromium-php-master -type f -name composer.lock -delete
@curl -sSL https://github.com/chrome-php/headless-chromium-php/archive/0.10.zip -o pdf_tmp.zip && unzip pdf_tmp.zip -d htdocs/lib/chrome-php && rm pdf_tmp.zip
@php external/composer.phar --working-dir=htdocs/lib/chrome-php/headless-chromium-php-0.10 install
@find htdocs/lib/chrome-php/headless-chromium-php-0.10 -type f -name composer.json -delete
@find htdocs/lib/chrome-php/headless-chromium-php-0.10 -type f -name composer.lock -delete
@find htdocs/lib/chrome-php -type d -name Tests -exec rm -r {} +
@echo "Done!"
endif
......
......@@ -16,7 +16,7 @@ if (db_table_exists('export_installed')) {
$pdfactive = get_field('export_installed', 'active', 'name', 'pdf');
}
$chromephpexists = file_exists(get_config('docroot') . 'lib/chrome-php/headless-chromium-php-master/vendor/autoload.php');
$chromephpexists = file_exists(get_config('docroot') . 'lib/chrome-php/headless-chromium-php-0.10/vendor/autoload.php');
if (($pdfactive && !$chromephpexists) ||
($pdfactive && $chromephpexists && !get_config('usepdfexport'))) {
global $SESSION;
......@@ -31,7 +31,7 @@ if (($pdfactive && !$chromephpexists) ||
}
}
else if ($pdfactive) {
require_once(get_config('docroot') . 'lib/chrome-php/headless-chromium-php-master/vendor/autoload.php');
require_once(get_config('docroot') . 'lib/chrome-php/headless-chromium-php-0.10/vendor/autoload.php');
}
use HeadlessChromium\BrowserFactory;
use HeadlessChromium\Cookies\Cookie;
......@@ -116,7 +116,7 @@ class PluginExportPdf extends PluginExportHtml {
$needs = get_string('needschromeheadless', 'export.pdf');
// make sure that composer has installed the headlessbrowser hook
$requires = array();
if (!file_exists(get_config('docroot') . 'lib/chrome-php/headless-chromium-php-master/src/BrowserFactory.php')) {
if (!file_exists(get_config('docroot') . 'lib/chrome-php/headless-chromium-php-0.10/src/BrowserFactory.php')) {
$requires[] = get_string('needschromeheadlessphp', 'export.pdf');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment