Emacs minor mode to evaluate PHP code in the Boris PHP REPL
Emacs Lisp
Pull request Compare This branch is 8 commits behind steckerhalter:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.org
php-boris-minor-mode.el

README.org

php-boris-minor-mode

Evaluate PHP code in the Boris PHP REPL

An Emacs minor mode that adds keyboard shortcuts to php-mode to send code from a PHP buffer to the Boris PHP REPL and evaluate it there.

Prerequisites

  • boris - PHP Read Eval Print Loop (REPL)

    https://github.com/d11wtq/Boris

    I had to comment this in php.ini for Boris to work:

    ; disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
        
  • php-boris - an Emacs extension for Boris

    From MELPA, install via M-x package-install

Installation

Manually

Load/evaluate the code and require php-boris-minor-mode.el

(with-temp-buffer
  (url-insert-file-contents "https://raw.github.com/steckerhalter/php-boris-minor-mode/master/php-boris-minor-mode.el")
  (eval-buffer))
(require 'php-boris-minor-mode)

El-Get Recipe

(:name php-boris-minor-mode
       :type git
       :url "https://github.com/steckerhalter/php-boris-minor-mode")

Usage

Open a PHP buffer in Emacs and press C-c C-c on a line to send that to Boris. The REPL will pop up and you can see the result there. If a region is active it will send that to the REPL.

Available shortcuts:

Keyboard shortcutDescription
C-c C-cEvaluate either the current statement or the active region (do what I mean)
C-c C-kEvaluate the current buffer in the REPL
C-c C-rEvaluate the the active region
C-c C-zSwitch to the REPL buffer, opening a new REPL if none exists
C-M-xEvaluate the function at point