Skip to content

Commit 878472a

Browse files
committed
Build the phar without stripping whitespace and comments to allow for PHP 8.1 support
This was previously stripping annotations that caused 8.1 notices. Building on 8.0+ resolved this, but then made the phar incompatible with PHP < 8.0.
1 parent 5e4e715 commit 878472a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scripts/build-phar.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,14 @@
6565
}
6666

6767
$path = 'src'.substr($fullpath, $srcDirLen);
68-
69-
$phar->addFromString($path, php_strip_whitespace($fullpath));
68+
$phar->addFile($fullpath, $path);
7069
}
7170

7271
// Add autoloader.
73-
$phar->addFromString('autoload.php', php_strip_whitespace(realpath(__DIR__.'/../autoload.php')));
72+
$phar->addFile(realpath(__DIR__.'/../autoload.php'), 'autoload.php');
7473

7574
// Add licence file.
76-
$phar->addFromString('licence.txt', php_strip_whitespace(realpath(__DIR__.'/../licence.txt')));
75+
$phar->addFile(realpath(__DIR__.'/../licence.txt'), 'licence.txt');
7776

7877
echo 'done'.PHP_EOL;
7978

0 commit comments

Comments
 (0)