summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorCyril Roelandt <tipecaml@gmail.com>2018-11-01 18:20:48 +0100
committerCyril Roelandt <tipecaml@gmail.com>2018-11-01 18:52:28 +0100
commitf34c089685d1437f523e9c947c06b402f12c4b95 (patch)
tree48ddd88a98fd89747be573c61f688f7f65a3d052 /ale_linters
parent4b841b55869e3ec5b02806f9b2fe962ffdca2750 (diff)
downloadale-f34c089685d1437f523e9c947c06b402f12c4b95.zip
PHP linter: make the path to the executable configurable
Fixes #1388
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/php/php.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/ale_linters/php/php.vim b/ale_linters/php/php.vim
index 6470383b..5d87196c 100644
--- a/ale_linters/php/php.vim
+++ b/ale_linters/php/php.vim
@@ -1,6 +1,8 @@
" Author: Spencer Wood <https://github.com/scwood>, Adriaan Zonnenberg <amz@adriaan.xyz>
" Description: This file adds support for checking PHP with php-cli
+call ale#Set('php_php_executable', 'php')
+
function! ale_linters#php#php#Handle(buffer, lines) abort
" Matches patterns like the following:
"
@@ -30,8 +32,8 @@ endfunction
call ale#linter#Define('php', {
\ 'name': 'php',
-\ 'executable': 'php',
+\ 'executable_callback': ale#VarFunc('php_php_executable'),
\ 'output_stream': 'stdout',
-\ 'command': 'php -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 --',
+\ 'command': '%e -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 --',
\ 'callback': 'ale_linters#php#php#Handle',
\})