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));
9 Phar::mapPhar('psysh.phar');
10 require 'phar://psysh.phar/.box/check_requirements.php';
11 require 'phar://psysh.phar/vendor/autoload.php';
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);
18 $content .= '__HALT_COMPILER();';
20 @mkdir(dirname(__DIR__) . '/build');
22 file_put_contents(dirname(__DIR__) . '/build/stub', $content);