From b158232fdc418437aebe2baacabeef289e0537c3 Mon Sep 17 00:00:00 2001 From: stardiviner Date: Thu, 20 Feb 2020 23:14:15 +0800 Subject: [PATCH] contrib/lisp/ob-php.el: Support change evaluate command specify options. * contrib/lisp/ob-php.el (org-babel-php-command): Add new customizable option `org-babel-php-command` to change default command. * contrib/lisp/ob-php.el (org-babel-php-command-options): Add new customizable option `org-babel-php-command-options` to specify command options. * contrib/lisp/ob-php.el (org-babel-execute:php): Use new commands in execute function. --- contrib/lisp/ob-php.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/contrib/lisp/ob-php.el b/contrib/lisp/ob-php.el index 1befbd248..43aede26c 100644 --- a/contrib/lisp/ob-php.el +++ b/contrib/lisp/ob-php.el @@ -21,6 +21,16 @@ (defgroup ob-php nil "org-mode blocks for PHP." :group 'org) +(defcustom org-babel-php-command "php" + "The command to execute babel body code." + :group 'ob-php + :type 'string) + +(defcustom org-babel-php-command-options nil + "The php command options to use when execute code." + :group 'ob-php + :type 'string) + (defcustom ob-php:inf-php-buffer "*php*" "Default PHP inferior buffer." :group 'ob-php @@ -29,10 +39,9 @@ (defcustom ob-php:inf-php-buffer "*php*" ;;;###autoload (defun org-babel-execute:php (body params) "Orgmode Babel PHP evaluate function for `BODY' with `PARAMS'." - (let* ((cmd "php") + (let* ((cmd (concat org-babel-php-command " " org-babel-php-command-options)) (body (concat ""))) - (org-babel-eval cmd body) - )) + (org-babel-eval cmd body))) ;;;###autoload (eval-after-load "org" -- 2.25.0