Is there a way to run a bootstrap code at every start of PHP interactive shell? Something like this:
JavaScript
x
php --bootstrap "autoload.php" -a
Advertisement
Answer
You can use the auto_append_file
directive for your cli configuration.
Example mine:
JavaScript
auto_prepend_file = /mnt/d/temp/boot.php
boot.php
file:
JavaScript
<?php
$code = "aabbcc";
php -a
test:
JavaScript
ariefbayu@DESKTOP-E76L6HH:/mnt/d/temp$ php -a
Interactive mode enabled
php > echo $code;
aabbcc
php >