branch: elpa/php-mode
commit 09855bdbd64ffb8ab77f023929d3a508508d05ac
Merge: 78e2c8b9a2 8491d67da7
Author: USAMI Kenta <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #818 from emacs-php/refactor/php-executable-core
Take php-executable from php-core instead of guessing at it
---
lisp/php-flymake.el | 3 ++-
lisp/php-project.el | 11 +++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/lisp/php-flymake.el b/lisp/php-flymake.el
index 25ae9083ba..00bafba88d 100644
--- a/lisp/php-flymake.el
+++ b/lisp/php-flymake.el
@@ -27,6 +27,7 @@
;;; Code:
(require 'flymake)
(require 'cl-lib)
+(require 'php-core)
(eval-and-compile
(require 'flymake-proc))
(eval-when-compile
@@ -101,7 +102,7 @@ See `flymake-diagnostic-functions' about REPORT-FN and ARGS
parameters."
(defun php-flymake--build-command-line (file)
"Return the command line for `php -l' FILE."
(let* ((command-args (or php-flymake-executable-command-args
- (list (or (bound-and-true-p php-executable)
"php"))))
+ (list php-executable)))
(cmd (car-safe command-args))
(default-directory (expand-file-name "~")))
(unless (or (file-executable-p cmd)
diff --git a/lisp/php-project.el b/lisp/php-project.el
index 570c162dd1..e057b5fe6a 100644
--- a/lisp/php-project.el
+++ b/lisp/php-project.el
@@ -58,6 +58,7 @@
;;; Code:
(eval-when-compile
(require 'cl-lib))
+(require 'php-core)
(require 'projectile nil t)
;; Constants
@@ -217,12 +218,10 @@ Typically it is `pear', `drupal', `wordpress', `symfony2'
and `psr2'.")
(defun php-project-get-php-executable ()
"Return path to PHP executable file."
- (cond
- ((and (stringp php-project-php-executable)
- (file-executable-p php-project-php-executable))
- php-project-php-executable)
- ((boundp 'php-executable) php-executable)
- (t (executable-find "php"))))
+ (if (and (stringp php-project-php-executable)
+ (file-executable-p php-project-php-executable))
+ php-project-php-executable
+ php-executable))
(defun php-project-get-file-html-template-type (filename)
"Return symbol T, NIL or `auto' by `FILENAME'."