Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328087 - PHP Executables - Search registers different exe with same name
Summary: PHP Executables - Search registers different exe with same name
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP Debug CLA
QA Contact: Ilina Stefanova CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-18 20:45 EDT by Toshihiro Izumi CLA
Modified: 2020-05-14 11:25 EDT (History)
3 users (show)

See Also:


Attachments
patch (964 bytes, patch)
2010-10-19 03:20 EDT, xu jiaxi CLA
jacek.pospychala: iplog+
Details | Diff
new patch (1.04 KB, patch)
2010-10-20 22:31 EDT, xu jiaxi CLA
jacek.pospychala: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.