0d26110eab7ce2dc836e79f6096c76436ca12aac
[yaffs-website] / vendor / psy / psysh / bin / build-stub
1 #!/usr/bin/env php
2 <?php
3
4 $license = file_get_contents(dirname(__DIR__) . '/LICENSE');
5 $license = str_replace('The MIT License (MIT)', '', $license);
6 $license = str_replace("\n", "\n * ", trim($license));
7
8 $autoload = <<<'EOS'
9     Phar::mapPhar('psysh.phar');
10     require 'phar://psysh.phar/.box/check_requirements.php';
11     require 'phar://psysh.phar/vendor/autoload.php';
12 EOS;
13
14 $content = file_get_contents(dirname(__DIR__) . '/bin/psysh');
15 $content = preg_replace('{/\* <<<.*?>>> \*/}sm', $autoload, $content);
16 $content = preg_replace('/\\(c\\) .*?with this source code./sm', $license, $content);
17
18 $content .= '__HALT_COMPILER();';
19
20 @mkdir(dirname(__DIR__) . '/build');
21
22 file_put_contents(dirname(__DIR__) . '/build/stub', $content);