Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328087

Summary: PHP Executables - Search registers different exe with same name
Product: z_Archived Reporter: Toshihiro Izumi <euthanasia_waltz>
Component: PDTAssignee: PHP Debug <php.debug-inbox>
Status: CLOSED FIXED QA Contact: Ilina Stefanova <ilina.s>
Severity: normal    
Priority: P3 CC: ilina.s, jacek.pospychala, zhaozhongwei
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch
jacek.pospychala: iplog+
new patch jacek.pospychala: iplog+

Description Toshihiro Izumi CLA 2010-10-18 20:45:50 EDT
Steps to reproduce:

1. Extract some php archives under same folder
e.g.
C:\php
	\php-5.3.3-nts-Win32-VC9-x86
		\dev
		\ext
		\extras
		\PEAR
	\php-5.3.3-Win32-VC6-x86
		\dev
		\ext
		\extras
		\PEAR
2. Open Preferences > PHP > PHP Executables
3. Click Search and select C:\php to search in
4. Following entries will be appeared
	PHP 5.3.3 (CLI) : Zend Debugger : C:\php\php-5.3.3-nts-Win32-VC9-x86\php.exe
	PHP 5.3.3 (CLI) : Zend Debugger : C:\php\php-5.3.3-Win32-VC6-x86\php.exe
5. Click OK to close preferences and reopen it again
6. Now you can see only
	PHP 5.3.3 (CLI) : Zend Debugger : C:\php\php-5.3.3-Win32-VC6-x86\php.exe

Cause:
org.eclipse.php.internal.debug.ui.preferences.phps.InstalledPHPsBlock.search()

737: String nameCopy = new String(phpExe.getName());
738: int i = 1;
739: while (isDuplicateName(nameCopy)) {
740: 	nameCopy = phpExe.getName() + '[' + i++ + ']';
741: }
//
746: if (phpExe.getExecutable() != null) {
747: 	fPHPexes.add(phpExe);
748: 	phpExes.addItem(phpExe);
749: 	fPHPExeList.refresh();
750: }

nameCopy is not used.
Comment 1 xu jiaxi CLA 2010-10-19 03:20:20 EDT
Created attachment 181154 [details]
patch

Thanks, izumi
Comment 2 Zhongwei Zhao CLA 2010-10-19 03:49:13 EDT
committed to head,thank you,guys!
Comment 3 Toshihiro Izumi CLA 2010-10-20 19:35:47 EDT
Thank you guys, but I don't like such as
	PHP 5.3.3 (CLI)
	PHP 5.3.3 (CLI)[1]
	PHP 5.3.3 (CLI)[1][2]

my code
>while (isDuplicateName(nameCopy)) {
>	nameCopy = phpExe.getName() + " [" + i++ + "]";
>}
>phpExe.setName(nameCopy);
Comment 4 xu jiaxi CLA 2010-10-20 22:31:03 EDT
Created attachment 181353 [details]
new patch

I'm so sorry. My fault.
Comment 5 Zhongwei Zhao CLA 2010-10-20 23:30:24 EDT
committed to head,thanks Xu and Izumi
Comment 6 Toshihiro Izumi CLA 2010-10-21 19:44:44 EDT
Thank you so much :-)
Comment 7 Zhongwei Zhao CLA 2011-04-15 00:58:34 EDT
change status
Comment 8 Ilina Stefanova CLA 2011-07-27 07:04:28 EDT
Verified.