Currently MediaWiki provides a custom console via eval.php, which is integrated with the wiki's environment but otherwise rather poor (no proper readline support, no fatal error handling, the P part of REPL is missing, no tab autocompletion, no reflection...). Vagrant provides phpsh / hhvmsh which is somewhat better but still mediocre. It would be nice to replace these with a great REPL like PsySH or Boris.
Landed as maintenance/shell.php.
Things to maybe improve listed by @Tgr:
- Unicode support (T69924 - seems to be a HHVM bug)
- get the dependencies to WMF production (https://gerrit.wikimedia.org/r/#/c/339584/)
- fix issues (P5001, P5002) with Vagrant: a778ea13, https://gerrit.wikimedia.org/r/#/c/371722
- work around psysh#443 if not fixed upstream
- replace/warn for old commands (eval.pgp, phpsh, mwrepl): https://gerrit.wikimedia.org/r/#/c/371723 https://gerrit.wikimedia.org/r/#/c/371760
- use personal readline configuration
- preserve readline history between sessions (turned out to be a vagrant bug, see https://gerrit.wikimedia.org/r/#/c/371722 )
- install the PHP docs (so that help and reflection in PsySH works)
- integrate with PSR-3 logging (add a flag to show what has been logged during a command)
add [[http://php.net/manual/en/language.oop5.magic.php#object.debuginfo|__debugInfo()]] to MediaWiki classes (used by VarDumper which is used by PsySH)probably a bad idea
- add a custom tab completion matcher, to support __get-based stuff. (Not sure if there is a good use case for that now. In the future, maybe services defined by extensions?)
try to interact with the HHVM debugger (breakpoints etc)?HHVM is going away so not worth the effort