Skip to content

Commit 09855bd

Browse files
authored
Merge pull request #818 from emacs-php/refactor/php-executable-core
Take php-executable from php-core instead of guessing at it
2 parents 78e2c8b + 8491d67 commit 09855bd

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lisp/php-flymake.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
;;; Code:
2828
(require 'flymake)
2929
(require 'cl-lib)
30+
(require 'php-core)
3031
(eval-and-compile
3132
(require 'flymake-proc))
3233
(eval-when-compile
@@ -101,7 +102,7 @@ See `flymake-diagnostic-functions' about REPORT-FN and ARGS parameters."
101102
(defun php-flymake--build-command-line (file)
102103
"Return the command line for `php -l' FILE."
103104
(let* ((command-args (or php-flymake-executable-command-args
104-
(list (or (bound-and-true-p php-executable) "php"))))
105+
(list php-executable)))
105106
(cmd (car-safe command-args))
106107
(default-directory (expand-file-name "~")))
107108
(unless (or (file-executable-p cmd)

lisp/php-project.el

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
;;; Code:
5959
(eval-when-compile
6060
(require 'cl-lib))
61+
(require 'php-core)
6162
(require 'projectile nil t)
6263

6364
;; Constants
@@ -217,12 +218,10 @@ Typically it is `pear', `drupal', `wordpress', `symfony2' and `psr2'.")
217218

218219
(defun php-project-get-php-executable ()
219220
"Return path to PHP executable file."
220-
(cond
221-
((and (stringp php-project-php-executable)
222-
(file-executable-p php-project-php-executable))
223-
php-project-php-executable)
224-
((boundp 'php-executable) php-executable)
225-
(t (executable-find "php"))))
221+
(if (and (stringp php-project-php-executable)
222+
(file-executable-p php-project-php-executable))
223+
php-project-php-executable
224+
php-executable))
226225

227226
(defun php-project-get-file-html-template-type (filename)
228227
"Return symbol T, NIL or `auto' by `FILENAME'."

0 commit comments

Comments
 (0)