Add psysh as a repl
This commit is contained in:
parent
df8c169d3d
commit
924292c8ab
2 changed files with 33 additions and 0 deletions
|
|
@ -4,6 +4,13 @@ RUN apt-get -qq update && \
|
|||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install a funky cool repl.
|
||||
RUN composer global require -q psy/psysh:@stable && \
|
||||
ln -s /root/.composer/vendor/psy/psysh/bin/psysh /usr/local/bin/repl && \
|
||||
/usr/local/bin/repl -v
|
||||
|
||||
COPY psysh-config.php /root/.config/psysh/config.php
|
||||
|
||||
# On build, add anything in with Dockerfile into /app
|
||||
ONBUILD ADD ./ /app
|
||||
|
||||
|
|
|
|||
26
php+cli/psysh-config.php
Normal file
26
php+cli/psysh-config.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
$autoloadersThatMayExist = [
|
||||
'/app/vendor/autoload.php',
|
||||
'/app/bootstrap.php',
|
||||
];
|
||||
|
||||
$defaultIncludes = [];
|
||||
|
||||
foreach($autoloadersThatMayExist as $autoloader){
|
||||
if(file_exists($autoloader)){
|
||||
$defaultIncludes[] = $autoloader;
|
||||
}
|
||||
}
|
||||
|
||||
$animals = ['🐟', '🐁', '🐄', '🐆', '🐉', '🐍', '🐌', '🐋', '🐊','🐕','🐔', '🐒','🐢'];
|
||||
|
||||
return [
|
||||
'commands' => [
|
||||
new \Psy\Command\ParseCommand,
|
||||
],
|
||||
'defaultIncludes' => $defaultIncludes,
|
||||
'startupMessage' => sprintf('You are on <error>%s</error> Uptime: <info>%s</info>', trim(shell_exec('hostname')), trim(shell_exec('uptime -p'))),
|
||||
//'prompt' => $animals[array_rand($animals)],
|
||||
'updateCheck' => 'never',
|
||||
'useBracketedPaste' => true
|
||||
];
|
||||
Loading…
Reference in a new issue