| Summary: | Update PHP facet version accordingly to project PHP version | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Jacek Pospychala <jacek.pospychala> | ||||
| Component: | PDT | Assignee: | Martin Eisengardt <martin.eisengardt> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | robert, wywrzal | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Jacek Pospychala
Interesting scenario: user created PHP project with PHP 4, added facet that requires PHP 4 and then tries to switch PHP to version 5. It's impossible because added facet requires older PHP version. PDT should have proper error message that would let user know what's the problem and how to solve it. Does PHP already display a warning if the version number you set in the project properties does not match the php executable version number? I suggest to not confuse the users. So a simple synchronize should solve it. If the user wants to change the version within the project properties the facet should silently update. If the user wants to change the facet version the pdt property should silently be updated. But I will have a look at the jst plugin. Java does have the same problem: What happens if the user chooses a newer java-version and facets become obselete? We should behave in a similar way to jst. No there's currently no such warning, because there was no need to have PHP executable with version matching project prefs. PHP version in PDT prefs is first of all used by PHP parser/validator to validate against proper syntax and there are always parsers for all PHP versions available in preferences combo box. Launching is different story. When trying to launch a project, PDT will try to take the best available PHP exec, but user might well override it and it's not something we want to warn about in project preferences. It might turn out as well that most other facets will simply just depend upon PHP facet, not any specific version. Alternatively, PDT could try to change facet version, and if it's not possible due to constraints then show an error message and let user deal with it by himself (e.g. reconfigure facets) OK, I will give it a try (including the error message if it fails). But I will have a look how jst plugin handles it. Actually the facets and pdt version number is some minor information. It only says "I want to develop a project for php 5.3, enable namespace feature etc." It does not guarantee that you have the correct php executable. With the server feature the importance of the php version grows up. Because the servers may depend on the php version. Let us say, if the user has a project for php version 5.3 he cannot add it to a server that only is configured with php version 5.1. Is it ok to add the version synchronization code nearby http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/tree/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/OptionsConfigurationBlock.java#n618 ? Created attachment 221013 [details]
Additional patch for sync the php version with facets version
The php version is know synchronized with facets version. If the facets disallow changing the php version a message box is shown with "cancel" button.
However the synchronization on the other side (changing facets php version lead to changes in php preferences) is not finished. First of all we need to prevent endless loops, therefor detect if the facets version change was done manually or programmatically. This is not that easy because the php version is not yet saved to the preferences as soon as the version of tzhe facets will be changed.
thanks Martin! I'll review your patch. any news on this patch? :) ok, I applied it now. Sorry for the delay! I thought that maybe there's some better place to hook than PHPCoreOptionsConfigurationBlock. But let's stay with it for now. thanks Martin! Closing. |