summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2021-12-29 16:21:38 +0100
committerDaniel Weipert <code@drogueronin.de>2021-12-29 16:21:38 +0100
commit08e523874c18112d07ba23be84fe71ff83a9a175 (patch)
tree24020fa2a7839ece06f47a37f9c883e9c865aa7d /bin
Initial commitHEADmain
Diffstat (limited to 'bin')
-rw-r--r--bin/compile21
-rwxr-xr-xbin/dompdf10
2 files changed, 31 insertions, 0 deletions
diff --git a/bin/compile b/bin/compile
new file mode 100644
index 0000000..184219c
--- /dev/null
+++ b/bin/compile
@@ -0,0 +1,21 @@
+#!/usr/bin/env php
+<?php
+
+/*
+ * Dompdf doesn't work with PHAR archives
+ * @see https://github.com/dompdf/dompdf/issues/621
+ */
+
+$pharFile = dirname(__DIR__) . '/dompdf.phar';
+
+if (file_exists($pharFile)) {
+ unlink($pharFile);
+}
+
+$phar = new \Phar($pharFile);
+$phar->buildFromDirectory(dirname(__DIR__), '(bin/dompdf|src/DompdfCli.php|vendor)');
+$phar->setStub(
+ '#!/usr/bin/env php' . PHP_EOL .
+ $phar->createDefaultStub('bin/dompdf')
+);
+
diff --git a/bin/dompdf b/bin/dompdf
new file mode 100755
index 0000000..d5e72e7
--- /dev/null
+++ b/bin/dompdf
@@ -0,0 +1,10 @@
+#!/usr/bin/env php
+<?php
+
+// suppress Dompdf deprecation warnings
+error_reporting(E_ALL ^ E_DEPRECATED);
+
+require dirname(__DIR__) . '/vendor/autoload.php';
+
+new \DompdfCli\DompdfCli();
+