What is this and why it is useful
Ever wanted a nice REPL where you can run a bunch of simple Drupal code and immediately get feedback about what's returned?
Well now you can using boris and the power of drush scripts.
drush A command line shell and scripting interface for Drupal.
boris, a tiny REPL for PHP.
- A Drupal installation.
- A *NIX system and a shell
Save the following script and put it somewhere in your
$which_boris = exec('which boris');
$boris_path = is_link($which_boris) ? readlink($which_boris) : $which_boris;
$boris = new \Boris\Boris('drupal> ');
Launching the script from a Drupal installation makes boris bootstrap Drupal and you can start using the REPL as shown in the picture above.