summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstardiviner <numbchild@gmail.com>2020-02-20 23:14:15 +0800
committerBastien <bzg@gnu.org>2020-02-20 18:48:35 +0100
commit97d0514b0b8db1a1338bd589acddefeacc9134bc (patch)
treefffa8ac2287f45de14d43b25bb0db0b4a06c5ca9
parent1b2de14d8444602ec619a0884b8c7cafd08c68d9 (diff)
downloadorg-mode-97d0514b0b8db1a1338bd589acddefeacc9134bc.tar.gz
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.
-rw-r--r--contrib/lisp/ob-php.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/contrib/lisp/ob-php.el b/contrib/lisp/ob-php.el
index 1befbd2..43aede2 100644
--- a/contrib/lisp/ob-php.el
+++ b/contrib/lisp/ob-php.el
@@ -21,6 +21,16 @@
"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 @@
;;;###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 "<?php\n" body "\n?>")))
- (org-babel-eval cmd body)
- ))
+ (org-babel-eval cmd body)))
;;;###autoload
(eval-after-load "org"