From 2aa5c94c4e9355699bc1e4e5caffae42b4efb1f7 Mon Sep 17 00:00:00 2001 From: DumboJetEngine Date: Wed, 12 Oct 2016 10:52:31 +0300 Subject: [PATCH] Support php.executablePath setting (#18) --- src/extension.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 977217d..cbcf8ee 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -9,9 +9,11 @@ import * as net from 'net'; export function activate(context: vscode.ExtensionContext) { - // Check if PHP is available and version is ^7.0.0 - execFile('php', ['--version'], (err: NodeJS.ErrnoException, stdout: Buffer, stderr: Buffer) => { + const conf = vscode.workspace.getConfiguration('php'); + const executablePath = conf.get('executablePath') || 'php'; + // Check path (if PHP is available and version is ^7.0.0). + execFile(executablePath, ['--version'], (err: NodeJS.ErrnoException, stdout: Buffer, stderr: Buffer) => { if (err) { if (err.code === 'ENOENT') { vscode.window.showErrorMessage('PHP executable not found. You need PHP 7 installed and in your PATH');