aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2012-10-14 23:47:30 (EDT)
committerzzhongwei2012-10-14 23:47:30 (EDT)
commit250e9ea2f2c401c8d6d993a5951a0dd4ea75cd82 (patch)
tree456f1af8453727cdfa863de4c446bf683b8b83cd
parent80cb4b618417aa441030ff3431aa5c3b3ac4e8e5 (diff)
downloadorg.eclipse.pdt-250e9ea2f2c401c8d6d993a5951a0dd4ea75cd82.zip
org.eclipse.pdt-250e9ea2f2c401c8d6d993a5951a0dd4ea75cd82.tar.gz
org.eclipse.pdt-250e9ea2f2c401c8d6d993a5951a0dd4ea75cd82.tar.bz2
390596: php4 executable will not run
https://bugs.eclipse.org/bugs/show_bug.cgi?id=390596
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPExecutableLaunchDelegate.java37
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java166
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java26
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/PHPExecutableDebuggerInitializer.java14
4 files changed, 153 insertions, 90 deletions
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPExecutableLaunchDelegate.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPExecutableLaunchDelegate.java
index 6b6faf9..19f0192 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPExecutableLaunchDelegate.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPExecutableLaunchDelegate.java
@@ -61,8 +61,8 @@ public class PHPExecutableLaunchDelegate extends LaunchConfigurationDelegate {
public void debugPHPExecutable(ILaunch launch, String phpExe,
String fileToDebug) throws DebugException {
try {
- launch.setAttribute(IDebugParametersKeys.EXECUTABLE_LAUNCH, Boolean
- .toString(true));
+ launch.setAttribute(IDebugParametersKeys.EXECUTABLE_LAUNCH,
+ Boolean.toString(true));
IDebugParametersInitializer parametersInitializer = DebugParametersInitializersRegistry
.getBestMatchDebugParametersInitializer(launch);
@@ -85,9 +85,9 @@ public class PHPExecutableLaunchDelegate extends LaunchConfigurationDelegate {
Logger.logException(
"PHPDebugTarget: Debugger didn't find file to debug.", e1);
String errorMessage = PHPDebugCoreMessages.DebuggerFileNotFound_1;
- throw new DebugException(new Status(IStatus.ERROR, PHPDebugPlugin
- .getID(), IPHPDebugConstants.INTERNAL_ERROR, errorMessage,
- e1));
+ throw new DebugException(new Status(IStatus.ERROR,
+ PHPDebugPlugin.getID(), IPHPDebugConstants.INTERNAL_ERROR,
+ errorMessage, e1));
}
}
@@ -129,8 +129,8 @@ public class PHPExecutableLaunchDelegate extends LaunchConfigurationDelegate {
IPHPDebugConstants.ATTR_EXECUTABLE_LOCATION, item
.getExecutable().toString());
workingCopy.setAttribute(
- PHPDebugCorePreferenceNames.PHP_DEBUGGER_ID, item
- .getDebuggerID());
+ PHPDebugCorePreferenceNames.PHP_DEBUGGER_ID,
+ item.getDebuggerID());
if (item.getINILocation() != null) {
workingCopy.setAttribute(
IPHPDebugConstants.ATTR_INI_LOCATION, item
@@ -194,12 +194,11 @@ public class PHPExecutableLaunchDelegate extends LaunchConfigurationDelegate {
// Locate the php.ini by using the attribute. If the attribute was null,
// try to locate an php.ini that exists next to the executable.
File phpIni = (phpIniPath != null && new File(phpIniPath).exists()) ? new File(
- phpIniPath)
- : PHPINIUtil.findPHPIni(phpExeString);
+ phpIniPath) : PHPINIUtil.findPHPIni(phpExeString);
File tempIni = PHPINIUtil.prepareBeforeDebug(phpIni, phpExeString,
project);
- launch.setAttribute(IDebugParametersKeys.PHP_INI_LOCATION, tempIni
- .getAbsolutePath());
+ launch.setAttribute(IDebugParametersKeys.PHP_INI_LOCATION,
+ tempIni.getAbsolutePath());
if (mode.equals(ILaunchManager.DEBUG_MODE) || runWithDebugInfo == true) {
boolean stopAtFirstLine = configuration.getAttribute(
@@ -239,12 +238,12 @@ public class PHPExecutableLaunchDelegate extends LaunchConfigurationDelegate {
PHPSessionLaunchMapper.put(sessionID, launch);
// Define all needed debug attributes:
- launch.setAttribute(IDebugParametersKeys.PORT, Integer
- .toString(requestPort));
+ launch.setAttribute(IDebugParametersKeys.PORT,
+ Integer.toString(requestPort));
launch.setAttribute(IDebugParametersKeys.FIRST_LINE_BREAKPOINT,
Boolean.toString(stopAtFirstLine));
- launch.setAttribute(IDebugParametersKeys.SESSION_ID, Integer
- .toString(sessionID));
+ launch.setAttribute(IDebugParametersKeys.SESSION_ID,
+ Integer.toString(sessionID));
// Trigger the debug session by initiating a debug requset to the
// php.exe
@@ -268,10 +267,12 @@ public class PHPExecutableLaunchDelegate extends LaunchConfigurationDelegate {
// Detect PHP SAPI type:
String sapiType = null;
+ String phpV = null;
PHPexeItem[] items = PHPexes.getInstance().getAllItems();
for (PHPexeItem item : items) {
if (item.getExecutable().equals(phpExeFile)) {
sapiType = item.getSapiType();
+ phpV = item.getVersion();
break;
}
}
@@ -280,7 +281,8 @@ public class PHPExecutableLaunchDelegate extends LaunchConfigurationDelegate {
.getLaunchConfiguration());
String[] cmdLine = PHPLaunchUtilities.getCommandLine(launch
.getLaunchConfiguration(), phpExeString, phpConfigDir,
- fileName, sapiType == PHPexeItem.SAPI_CLI ? args : null);
+ fileName, sapiType == PHPexeItem.SAPI_CLI ? args : null,
+ phpV);
// Set library search path:
String libPath = PHPLaunchUtilities
@@ -327,8 +329,7 @@ public class PHPExecutableLaunchDelegate extends LaunchConfigurationDelegate {
subMonitor
.beginTask(
MessageFormat
- .format(
- "start launch", new Object[] { configuration.getName() }), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+ .format("start launch", new Object[] { configuration.getName() }), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
process = DebugPlugin.newProcess(launch, p,
phpExe.toOSString(), processAttributes);
if (process == null) {
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java
index fd94edf..e3c8a03 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/PHPLaunchUtilities.java
@@ -122,8 +122,7 @@ public class PHPLaunchUtilities {
}
if (shouldShowDebug) {
- page
- .showView("org.eclipse.debug.ui.PHPDebugOutput"); //$NON-NLS-1$
+ page.showView("org.eclipse.debug.ui.PHPDebugOutput"); //$NON-NLS-1$
}
} catch (Exception e) {
Logger.logException(
@@ -189,11 +188,10 @@ public class PHPLaunchUtilities {
final Display disp = Display.getDefault();
disp.syncExec(new Runnable() {
public void run() {
- MessageDialog
- .openInformation(
- disp.getActiveShell(),
- PHPDebugCoreMessages.PHPLaunchUtilities_phpLaunchTitle,
- PHPDebugCoreMessages.PHPLaunchUtilities_activeLaunchDetected);
+ MessageDialog.openInformation(
+ disp.getActiveShell(),
+ PHPDebugCoreMessages.PHPLaunchUtilities_phpLaunchTitle,
+ PHPDebugCoreMessages.PHPLaunchUtilities_activeLaunchDetected);
}
});
return false;
@@ -205,14 +203,13 @@ public class PHPLaunchUtilities {
public void run() {
// Display a dialog to notify the existence of a previous active
// launch.
- MessageDialogWithToggle m = MessageDialogWithToggle
- .openYesNoQuestion(
- disp.getActiveShell(),
- PHPDebugCoreMessages.PHPLaunchUtilities_confirmation,
- PHPDebugCoreMessages.PHPLaunchUtilities_multipleLaunchesPrompt,
- PHPDebugCoreMessages.PHPLaunchUtilities_rememberDecision,
- false, store,
- PreferenceConstants.ALLOW_MULTIPLE_LAUNCHES);
+ MessageDialogWithToggle m = MessageDialogWithToggle.openYesNoQuestion(
+ disp.getActiveShell(),
+ PHPDebugCoreMessages.PHPLaunchUtilities_confirmation,
+ PHPDebugCoreMessages.PHPLaunchUtilities_multipleLaunchesPrompt,
+ PHPDebugCoreMessages.PHPLaunchUtilities_rememberDecision,
+ false, store,
+ PreferenceConstants.ALLOW_MULTIPLE_LAUNCHES);
resultHolder.setReturnCode(m.getReturnCode());
}
});
@@ -288,11 +285,9 @@ public class PHPLaunchUtilities {
.openYesNoQuestion(
window.getShell(),
PHPDebugCoreMessages.PHPLaunchUtilities_PHPPerspectiveSwitchTitle,
- NLS
- .bind(
- PHPDebugCoreMessages.PHPLaunchUtilities_PHPPerspectiveSwitchMessage,
- new String[] { perspective
- .getLabel() }),
+ NLS.bind(
+ PHPDebugCoreMessages.PHPLaunchUtilities_PHPPerspectiveSwitchMessage,
+ new String[] { perspective.getLabel() }),
PHPDebugCoreMessages.PHPLaunchUtilities_rememberDecision,
false, store,
PreferenceConstants.SWITCH_BACK_TO_PHP_PERSPECTIVE);
@@ -365,31 +360,27 @@ public class PHPLaunchUtilities {
// TODO - Advanced message dialog with 'don't show this
// again' check.
if (fHasContiniousLaunch) {
- resultHolder
- .setResult(MessageDialog
- .openConfirm(
- Display.getDefault()
- .getActiveShell(),
- PHPDebugCoreMessages.PHPLaunchUtilities_confirmation,
- "A previous launch with 'Debug All Pages' or 'Start Debug From' attribute was identifed.\nLaunching a new session will terminate and remove the old launch, directing all future debug requests associated with it to the new launch.\nDo you wish to continue and launch a new session?")); //$NON-NLS-1$
+ resultHolder.setResult(MessageDialog
+ .openConfirm(
+ Display.getDefault().getActiveShell(),
+ PHPDebugCoreMessages.PHPLaunchUtilities_confirmation,
+ "A previous launch with 'Debug All Pages' or 'Start Debug From' attribute was identifed.\nLaunching a new session will terminate and remove the old launch, directing all future debug requests associated with it to the new launch.\nDo you wish to continue and launch a new session?")); //$NON-NLS-1$
} else {
if (newIsDebugAllPages) {
- resultHolder
- .setResult(MessageDialog
- .openConfirm(
- Display.getDefault()
- .getActiveShell(),
- PHPDebugCoreMessages.PHPLaunchUtilities_confirmation,
- "The requested launch has a 'Debug All Pages' attribute.\nLaunching this type of session will terminate and remove any other previous launches.\nDo you wish to continue and launch the new session?")); //$NON-NLS-1$
+ resultHolder.setResult(MessageDialog
+ .openConfirm(
+ Display.getDefault()
+ .getActiveShell(),
+ PHPDebugCoreMessages.PHPLaunchUtilities_confirmation,
+ "The requested launch has a 'Debug All Pages' attribute.\nLaunching this type of session will terminate and remove any other previous launches.\nDo you wish to continue and launch the new session?")); //$NON-NLS-1$
} else {
// newIsStartDebugFrom == true
- resultHolder
- .setResult(MessageDialog
- .openConfirm(
- Display.getDefault()
- .getActiveShell(),
- PHPDebugCoreMessages.PHPLaunchUtilities_confirmation,
- "The requested launch has a 'Start Debug From' attribute.\nLaunching this type of session will terminate and remove any other previous launches.\nDo you wish to continue and launch the new session?")); //$NON-NLS-1$
+ resultHolder.setResult(MessageDialog
+ .openConfirm(
+ Display.getDefault()
+ .getActiveShell(),
+ PHPDebugCoreMessages.PHPLaunchUtilities_confirmation,
+ "The requested launch has a 'Start Debug From' attribute.\nLaunching this type of session will terminate and remove any other previous launches.\nDo you wish to continue and launch the new session?")); //$NON-NLS-1$
}
}
if (resultHolder.getResult()) {
@@ -741,8 +732,8 @@ public class PHPLaunchUtilities {
for (String attribute : attributesArray) {
try {
int index = attribute.indexOf('=');
- map.put(attribute.substring(0, index), attribute
- .substring(index + 1));
+ map.put(attribute.substring(0, index),
+ attribute.substring(index + 1));
} catch (Exception e) {
Logger.logException("Error while parsing launch attribute '"
+ attribute + '\'', e);
@@ -799,6 +790,33 @@ public class PHPLaunchUtilities {
return env;
}
+ public static Map<String, String> getPHP54BuildinServerLaunchEnvironment(
+ String fileName, String query, String phpConfigDir,
+ String phpExeDir, String[] scriptArguments) {
+ Map<String, String> env = new HashMap<String, String>();
+ env.put("REQUEST_METHOD", "GET"); //$NON-NLS-1$ //$NON-NLS-2$
+ // env.put("SCRIPT_FILENAME", fileName); //$NON-NLS-1$
+ // env.put("SCRIPT_NAME", fileName); //$NON-NLS-1$
+ // env.put("PATH_TRANSLATED", fileName); //$NON-NLS-1$
+ // env.put("PATH_INFO", fileName); //$NON-NLS-1$
+
+ // Build query string
+ StringBuilder queryStringBuf = new StringBuilder(query);
+ queryStringBuf.append("&debug_host=127.0.0.1"); //$NON-NLS-1$
+ if (scriptArguments != null) {
+ for (String arg : scriptArguments) {
+ queryStringBuf.append('&').append(arg);
+ }
+ }
+ env.put("QUERY_STRING", queryStringBuf.toString());
+ env.put("REDIRECT_STATUS", "1"); //$NON-NLS-1$
+ env.put("PHPRC", phpConfigDir); //$NON-NLS-1$
+
+ appendLibrarySearchPathEnv(env, new File(phpExeDir));
+
+ return env;
+ }
+
/**
* Appends needed environment variable that says where to look for 3rd party
* libraries depending on the OS.
@@ -893,12 +911,13 @@ public class PHPLaunchUtilities {
* @param args
* Command line arguments, if using PHP CLI, otherwise -
* <code>null</code>
+ * @param phpVersion
* @return commands array
* @throws CoreException
*/
public static String[] getCommandLine(ILaunchConfiguration configuration,
- String phpExe, String phpConfigDir, String scriptPath, String[] args)
- throws CoreException {
+ String phpExe, String phpConfigDir, String scriptPath,
+ String[] args, String phpVersion) throws CoreException {
// Check if we should treat ASP tags as PHP tags
IProject project = getProject(configuration);
String aspTags = ProjectOptions.isSupportingAspTags(project) ? "on"
@@ -907,9 +926,49 @@ public class PHPLaunchUtilities {
: "off";
List<String> cmdLineList = new LinkedList<String>();
- cmdLineList.addAll(Arrays.asList(new String[] { phpExe, "-n", "-c",
- phpConfigDir, "-d", "asp_tags=" + aspTags, "-d",
- "short_open_tag=" + shortOpenTag, scriptPath }));
+ if (phpVersion != null && phpVersion.startsWith("4")) {
+ cmdLineList.addAll(Arrays.asList(new String[] { phpExe, "-c",
+ phpConfigDir, "-d", "asp_tags=" + aspTags, "-d",
+ "short_open_tag=" + shortOpenTag, scriptPath }));
+ } else {
+ cmdLineList.addAll(Arrays.asList(new String[] { phpExe, "-n", "-c",
+ phpConfigDir, "-d", "asp_tags=" + aspTags, "-d",
+ "short_open_tag=" + shortOpenTag, scriptPath }));
+ }
+ if (args != null) {
+ cmdLineList.addAll(Arrays.asList(args));
+ }
+ return cmdLineList.toArray(new String[cmdLineList.size()]);
+ }
+
+ public static String[] getCommandLineForPHP54BuildinServer(
+ ILaunchConfiguration configuration, String phpExe,
+ String phpConfigDir, String server, String root, String routerFile,
+ String[] args) throws CoreException {
+ // Check if we should treat ASP tags as PHP tags
+ IProject project = getProject(configuration);
+ String aspTags = ProjectOptions.isSupportingAspTags(project) ? "on"
+ : "off";
+ String shortOpenTag = ProjectOptions.useShortTags(project) ? "on"
+ : "off";
+ if (server.startsWith("http://")) {
+ server = server.substring(7);
+ } else if (server.startsWith("https://")) {
+ server = server.substring(8);
+ }
+
+ List<String> cmdLineList = new LinkedList<String>();
+ if (routerFile == null) {
+ cmdLineList.addAll(Arrays.asList(new String[] { phpExe, "-S",
+ server, "-t", root, "-n", "-c", phpConfigDir, "-d",
+ "asp_tags=" + aspTags, "-d",
+ "short_open_tag=" + shortOpenTag }));
+ } else {
+ cmdLineList.addAll(Arrays.asList(new String[] { phpExe, "-S",
+ server, "-t", root, routerFile, "-n", "-c", phpConfigDir,
+ "-d", "asp_tags=" + aspTags, "-d",
+ "short_open_tag=" + shortOpenTag }));
+ }
if (args != null) {
cmdLineList.addAll(Arrays.asList(args));
}
@@ -1051,10 +1110,9 @@ public class PHPLaunchUtilities {
} catch (CoreException e) {
Logger.logException("Error obtaining an SSHTunnel instance", e);//$NON-NLS-1$
} catch (StorageException e) {
- Logger
- .logException(
- "Error accessing the secured storage for the debug SSH tunnel",//$NON-NLS-1$
- e);
+ Logger.logException(
+ "Error accessing the secured storage for the debug SSH tunnel",//$NON-NLS-1$
+ e);
}
return null;
}
@@ -1068,8 +1126,8 @@ public class PHPLaunchUtilities {
public static int getDebugPort(ILaunchConfiguration launchConfiguration) {
try {
String debuggerID = launchConfiguration.getAttribute(
- PHPDebugCorePreferenceNames.PHP_DEBUGGER_ID, PHPDebugPlugin
- .getCurrentDebuggerId());
+ PHPDebugCorePreferenceNames.PHP_DEBUGGER_ID,
+ PHPDebugPlugin.getCurrentDebuggerId());
AbstractDebuggerConfiguration debuggerConfiguration = PHPDebuggersRegistry
.getDebuggerConfiguration(debuggerID);
return debuggerConfiguration.getPort();
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java
index 3ad7500..ed9ed0e 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/launching/XDebugExeLaunchConfigurationDelegate.java
@@ -126,12 +126,11 @@ public class XDebugExeLaunchConfigurationDelegate extends
// Locate the php ini by using the attribute. If the attribute was null,
// try to locate an ini that exists next to the executable.
File phpIni = (phpIniString != null && new File(phpIniString).exists()) ? new File(
- phpIniString)
- : PHPINIUtil.findPHPIni(phpExeString);
+ phpIniString) : PHPINIUtil.findPHPIni(phpExeString);
File tempIni = PHPINIUtil.prepareBeforeDebug(phpIni, phpExeString,
project);
- launch.setAttribute(IDebugParametersKeys.PHP_INI_LOCATION, tempIni
- .getAbsolutePath());
+ launch.setAttribute(IDebugParametersKeys.PHP_INI_LOCATION,
+ tempIni.getAbsolutePath());
// add process type to process attributes, basically the name of the exe
// that was launched
@@ -177,8 +176,8 @@ public class XDebugExeLaunchConfigurationDelegate extends
if (DBGpProxyHandler.instance.registerWithProxy() == false) {
displayErrorMessage(PHPDebugCoreMessages.XDebug_ExeLaunchConfigurationDelegate_2
+ DBGpProxyHandler.instance.getErrorMsg()); //$NON-NLS-1$
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(
- launch);
+ DebugPlugin.getDefault().getLaunchManager()
+ .removeLaunch(launch);
return;
}
} else {
@@ -223,10 +222,12 @@ public class XDebugExeLaunchConfigurationDelegate extends
// Detect PHP SAPI type and thus where we need arguments
File phpExeFile = new File(phpExeString);
String sapiType = null;
+ String phpV = null;
PHPexeItem[] items = PHPexes.getInstance().getAllItems();
for (PHPexeItem item : items) {
if (item.getExecutable().equals(phpExeFile)) {
sapiType = item.getSapiType();
+ phpV = item.getVersion();
break;
}
}
@@ -238,8 +239,9 @@ public class XDebugExeLaunchConfigurationDelegate extends
// define the command line for launching
String[] cmdLine = null;
- cmdLine = PHPLaunchUtilities.getCommandLine(configuration, phpExe
- .toOSString(), tempIni.toString(), phpFile.toOSString(), args);
+ cmdLine = PHPLaunchUtilities.getCommandLine(configuration,
+ phpExe.toOSString(), tempIni.toString(), phpFile.toOSString(),
+ args, phpV);
// Launch the process
final Process phpExeProcess = DebugPlugin.exec(cmdLine, workingDir,
@@ -270,11 +272,9 @@ public class XDebugExeLaunchConfigurationDelegate extends
launch.addDebugTarget(target);
subMonitor
.subTask(PHPDebugCoreMessages.XDebug_ExeLaunchConfigurationDelegate_4); //$NON-NLS-1$
- target
- .waitForInitialSession(
- (DBGpBreakpointFacade) IDELayerFactory
- .getIDELayer(), XDebugPreferenceMgr
- .createSessionPreferences(), monitor);
+ target.waitForInitialSession(
+ (DBGpBreakpointFacade) IDELayerFactory.getIDELayer(),
+ XDebugPreferenceMgr.createSessionPreferences(), monitor);
}
} else {
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/PHPExecutableDebuggerInitializer.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/PHPExecutableDebuggerInitializer.java
index c9062b0..58f6da9 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/PHPExecutableDebuggerInitializer.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/PHPExecutableDebuggerInitializer.java
@@ -89,10 +89,12 @@ public class PHPExecutableDebuggerInitializer {
// Detect PHP SAPI type:
String sapiType = null;
+ String phpV = null;
PHPexeItem[] items = PHPexes.getInstance().getAllItems();
for (PHPexeItem item : items) {
if (item.getExecutable().equals(phpExeFile)) {
sapiType = item.getSapiType();
+ phpV = item.getVersion();
break;
}
}
@@ -111,13 +113,15 @@ public class PHPExecutableDebuggerInitializer {
additionalLaunchEnvironment.putAll(envVariables);
envVariables = additionalLaunchEnvironment;
}
- String[] environmetVars = PHPLaunchUtilities.getEnvironment(launch
- .getLaunchConfiguration(), asAttributesArray(envVariables));
+ String[] environmetVars = PHPLaunchUtilities.getEnvironment(
+ launch.getLaunchConfiguration(),
+ asAttributesArray(envVariables));
// Prepare the command line.
- String[] phpCmdArray = PHPLaunchUtilities.getCommandLine(launch
- .getLaunchConfiguration(), phpExe, phpConfigDir, fileName,
- sapiType == PHPexeItem.SAPI_CLI ? args : null);
+ String[] phpCmdArray = PHPLaunchUtilities.getCommandLine(
+ launch.getLaunchConfiguration(), phpExe, phpConfigDir,
+ fileName, sapiType == PHPexeItem.SAPI_CLI ? args : null,
+ phpV);
// Make sure that we have executable permissions on the file.
PHPexes.changePermissions(new File(phpCmdArray[0]));