summaryrefslogtreecommitdiff
path: root/bin/compile
blob: 184219c430721c6b63777ce3e408c7d5165c71c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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')
);