summaryrefslogtreecommitdiff
path: root/bin/compile
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/compile
Initial commitHEADmain
Diffstat (limited to 'bin/compile')
-rw-r--r--bin/compile21
1 files changed, 21 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')
+);
+