summaryrefslogtreecommitdiff
path: root/bin/compile
diff options
context:
space:
mode:
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')
+);
+