Skip to content

Commit da77266

Browse files
committed
Added a check for phar.readonly
If `phar.readonly` in `php.ini` is set to On (by default) then the Phar couldn't be created. This change checks the setting and returns an error with a helpful message how to fix it. phar-readonly
1 parent 440ec21 commit da77266

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bin/build

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ if (file_exists($output . '.gz')) {
2727
if (file_exists($finalOutput)) {
2828
unlink($finalOutput);
2929
}
30+
31+
// check that phar.readonly to off
32+
if (1 == ini_get('phar.readonly')) {
33+
echo "Can't create a Phar file. Please set `phar.readonly = Off` in your php.ini\n";
34+
exit(1);
35+
}
36+
3037
// create phar
3138
$p = new Phar($output);
3239

0 commit comments

Comments
 (0)