|
| trying out PhpED and have a few questions. | |
Joined: 28 Nov 2011 |
Posts: 13 |
|
|
|
Posted: Mon Nov 28, 2011 4:28 pm |
|
|
|
|
|
I'm trying out PhpED for the first time. I've been a long time user of Zend Studio, but want to try something new. ZS is a strong IDE, but it has a lot of pit falls, especially those related to "Java" apps, and their development cycle is starting to annoy me.
So, there are a few things I'm looking for, but hadn't found within PhpED yet. Maybe you all can help:
- A way to differentiate Application root and Document Root? In my apps: Application Root != Apache Document Root.
- How do I copy a file? I want to copy, say, Base.php from one folder to another. Then edit it, changing the namespace.
- Changing the name of a folder or file doesn't update the namespace or class name. Not implemented? File rename was handy in ZS. It even updated classes references throughout the project, but it fell flat with namespaces (one of my gripes).
- Related note: variable refactor renaming? Change $this->row to $this->rows by renaming protected $row?
- How do I get JavaScript syntax highlighting in .phtml files? CSS? Using ZFW placeholder(), I have CSS and JS mixed _everywhere_ throughout my view scripts.
- How do I work with two projects at once? I work between old and new projects simultaneously (I'm refactoring old code to new code base). I want two full IDE windows, one with the old files, and the other with the new files. There's no "Open in New Window" option when I right click on the project.
- Shell Menu the only way to access SVN options? I saw a post saying I need both the 32bit and 64bit TortiseSVN in order for PhpED to recognize SVN, but TortistSVN won't let me install the 32bit version. It actually errors telling me to install the 64bit version. TortiseSVN shows in the Shell Menu, but there's no SVN in the Source Control options.
- Is there a way to enforce variable types? ZS allowed the following syntax /* @var $res \Models\Cost */ to let me force $res to that object type. It's useful in instances where you have an Iterator object, and you need to tell your IDE what class the variable is: $result is \Models\ResultSet (implements Iterator); foreach ( $results as $res ) { ... } $res is of type \Models\Cost
I'm sure there will be more. But those are what I ran into almost immediately while working with some quick bit of code. On the plus side PhpED does have a noticeably smaller footprint feel to it. Menus are snappy. Files open quick. Highlights are fast. Definitely none of the 'Java' app feel from Zend Studio.
I'm on the look out for an actual IDE, not just some glorified PHP Editor. I write PHP applications professionally using full OO style, using ZFW. I need an IDE that can keep up with the power of Java/.NET/Objective-C editors but for PHP. PhpED seems to be near, but there is some functionality I can't seem to locate I would have expected... hopefully I am just missing the options.
|
|
|
| Re: trying out PhpED and have a few questions. | |
Joined: 06 Jul 2009 |
Posts: 72 |
|
|
|
Posted: Tue Nov 29, 2011 3:46 am |
|
|
|
|
|
guice wrote: | I'm trying out PhpED for the first time. I've been a long time user of Zend Studio, but want to try something new. ZS is a strong IDE, but it has a lot of pit falls, especially those related to "Java" apps, and their development cycle is starting to annoy me.
So, there are a few things I'm looking for, but hadn't found within PhpED yet. Maybe you all can help:
[*] A way to differentiate Application root and Document Root? In my apps: Application Root != Apache Document Root. |
There's a 'Mapping' tab in the project prefs where you can set up path definitions.
Quote: | [*] How do I copy a file? I want to copy, say, Base.php from one folder to another. Then edit it, changing the namespace. |
Copying a file is a simply case of drag and dropping a file in the project tree. Moving can also be accomplished this way too if the Ctrl key is held down during the drag n drop process.
Quote: | [*] Changing the name of a folder or file doesn't update the namespace or class name. Not implemented? File rename was handy in ZS. It even updated classes references throughout the project, but it fell flat with namespaces (one of my gripes). |
Not sure on this one.
Quote: | [*] Related note: variable refactor renaming? Change $this->row to $this->rows by renaming protected $row? |
Unfortunately, PhpED doesn't have any kind of refactoring as yet. Something that has been requested a few times on this forum, and something that I'm seriously hoping will appear soon myself.
Quote: | [*] How do I get JavaScript syntax highlighting in .phtml files? CSS? Using ZFW placeholder(), I have CSS and JS mixed _everywhere_ throughout my view scripts. |
Enable the 'Dynamic Highlighting' option in settings (or there's a toolbar button for it too). This will then highlight CSS, JavaScript, Smarty, HTML, PHP in view templates no problem and will actually "grey out" (colour is definable) code of a different language.. ie: when you're editing javascript, the HTML would be greyed out making it easier to highlight the current editing language).
Quote: | [*] How do I work with two projects at once? I work between old and new projects simultaneously (I'm refactoring old code to new code base). I want two full IDE windows, one with the old files, and the other with the new files. There's no "Open in New Window" option when I right click on the project. |
You can import / create multiple projects within a workspace and work on the files simultaneously. Not sure if you can force 2 complete IDE instances.. but you can right-click on an open tab and set to 'Floating' which gives you an MDI-style application meaning that you could edit 2 files side-by-side.
Quote: | [*] Shell Menu the only way to access SVN options? I saw a post saying I need both the 32bit and 64bit TortiseSVN in order for PhpED to recognize SVN, but TortistSVN won't let me install the 32bit version. It actually errors telling me to install the 64bit version. TortiseSVN shows in the Shell Menu, but there's no SVN in the Source Control options. |
SVN 1.6.x required both 32-bit and 64-bit due to PhpED being a 32-bit app. Since SVN 1.7 (which I'm guessing you're running due to the error you received trying to install the 32-bit version), this is no longer required as the 64-bit version of SVN now contains the required 32-bit parts too. This was actually an SVN / OS type issue rather than PhpED as that simple relies on Explorer.
Holding Ctrl whilst right-clicking on a file / directory is a shortcut to opening the Shell menu.. which makes using SVN IMO, a hell of a lot easier than creating a new IDE layout (I forget the actual term used) in ZS.
Quote: | [*] Is there a way to enforce variable types? ZS allowed the following syntax /* @var $res \Models\Cost */ to let me force $res to that object type. It's useful in instances where you have an Iterator object, and you need to tell your IDE what class the variable is: $result is \Models\ResultSet (implements Iterator); foreach ( $results as $res ) { ... } $res is of type \Models\Cost |
Not sure on this one.
Quote: | I'm sure there will be more. But those are what I ran into almost immediately while working with some quick bit of code. On the plus side PhpED does have a noticeably smaller footprint feel to it. Menus are snappy. Files open quick. Highlights are fast. Definitely none of the 'Java' app feel from Zend Studio.
I'm on the look out for an actual IDE, not just some glorified PHP Editor. I write PHP applications professionally using full OO style, using ZFW. I need an IDE that can keep up with the power of Java/.NET/Objective-C editors but for PHP. PhpED seems to be near, but there is some functionality I can't seem to locate I would have expected... hopefully I am just missing the options. |
I think one of the biggest strengths of PhpED is the debugger. Personally I found ZS a convoluted royal PITA. It has some nice features that I would like to see in PhpED (refactoring as my primary for example) but I've been pretty happy with PhpED over the years, both for my Smarty projects (some being 5000+ files) and more recently, ZF projects. It's not perfect, but then nothing is.. but I'd definitely run the course of the trial and see how you get on.
Cheers..
Ian
|
|
|
| Re: trying out PhpED and have a few questions. | |
Joined: 28 Nov 2011 |
Posts: 13 |
|
|
|
Posted: Tue Nov 29, 2011 8:52 am |
|
|
|
|
|
Great info!
Ian.H wrote: | guice wrote: | [*] A way to differentiate Application root and Document Root? In my apps: Application Root != Apache Document Root. |
There's a 'Mapping' tab in the project prefs where you can set up path definitions. |
That didn't seem to solve my problem. The issue I ran into was in the new project wizard. It asks for Document Root, not Application Root. Then it automatically creates your project based on document root, which, again, isn't application root. If you select the application root, the project tests all fail because, again, doc root != app root.
Ian.H wrote: | guice wrote: | [*] How do I copy a file? I want to copy, say, Base.php from one folder to another. Then edit it, changing the namespace. |
Copying a file is a simply case of drag and dropping a file in the project tree. Moving can also be accomplished this way too if the Ctrl key is held down during the drag n drop process. |
Oooooh! So, it's backwards from what I had expected. I looked for copy/paste in the Edit menu (grayed out). And I tried cntl-drag and it kept saying 'Move'. And to me, just drag/dropping is move (always had been in any Explorer and many other places). PhpED went a little backwards here.... oh boy, so that means when I need to move files, I'm going to get confused.
Ian.H wrote: | guice wrote: | [*] Changing the name of a folder or file doesn't update the namespace or class name. Not implemented? File rename was handy in ZS. It even updated classes references throughout the project, but it fell flat with namespaces (one of my gripes). |
Not sure on this one.
guice wrote: | [*] Related note: variable refactor renaming? Change $this->row to $this->rows by renaming protected $row? |
Unfortunately, PhpED doesn't have any kind of refactoring as yet. Something that has been requested a few times on this forum, and something that I'm seriously hoping will appear soon myself. |
ZS touts its refactor ability. Sadly, it falls flat on its ass when NS gets involved, and I'm not pleased by that.
Ian.H wrote: | guice wrote: | [*] How do I get JavaScript syntax highlighting in .phtml files? CSS? Using ZFW placeholder(), I have CSS and JS mixed _everywhere_ throughout my view scripts. |
Enable the 'Dynamic Highlighting' option in settings (or there's a toolbar button for it too). This will then highlight CSS, JavaScript, Smarty, HTML, PHP in view templates no problem and will actually "grey out" (colour is definable) code of a different language.. ie: when you're editing javascript, the HTML would be greyed out making it easier to highlight the current editing language). |
Ah ha! Found the problem. JS highlighting isn't obvious! I changed keywords to blue and look at that, it does highly JS. Sorry. My bad there.
Ian.H wrote: | guice wrote: | [*] How do I work with two projects at once? I work between old and new projects simultaneously (I'm refactoring old code to new code base). I want two full IDE windows, one with the old files, and the other with the new files. There's no "Open in New Window" option when I right click on the project. |
You can import / create multiple projects within a workspace and work on the files simultaneously. Not sure if you can force 2 complete IDE instances.. but you can right-click on an open tab and set to 'Floating' which gives you an MDI-style application meaning that you could edit 2 files side-by-side. |
That would suit my immediate needs. Although, I'd love some function to "MDI" a full project. I just need my old-code project in a different window for reference when refactoring.
Ian.H wrote: | guice wrote: | [*] Shell Menu the only way to access SVN options? I saw a post saying I need both the 32bit and 64bit TortiseSVN in order for PhpED to recognize SVN, but TortistSVN won't let me install the 32bit version. It actually errors telling me to install the 64bit version. TortiseSVN shows in the Shell Menu, but there's no SVN in the Source Control options. |
SVN 1.6.x required both 32-bit and 64-bit due to PhpED being a 32-bit app. Since SVN 1.7 (which I'm guessing you're running due to the error you received trying to install the 32-bit version), this is no longer required as the 64-bit version of SVN now contains the required 32-bit parts too. This was actually an SVN / OS type issue rather than PhpED as that simple relies on Explorer.
Holding Ctrl whilst right-clicking on a file / directory is a shortcut to opening the Shell menu.. which makes using SVN IMO, a hell of a lot easier than creating a new IDE layout (I forget the actual term used) in ZS.
|
That is correct. SVN 1.7. Good to know. Thanks. Oh, and it's perspective in ZS. Perspective are very handle when managing SVN -- I can hide all my code, and just show the repository, history, and windows releated to SVN.
Ian.H wrote: | guice wrote: | [*] Is there a way to enforce variable types? ZS allowed the following syntax /* @var $res \Models\Cost */ to let me force $res to that object type. It's useful in instances where you have an Iterator object, and you need to tell your IDE what class the variable is: $result is \Models\ResultSet (implements Iterator); foreach ( $results as $res ) { ... } $res is of type \Models\Cost |
Not sure on this one. |
Would be useful. It's one of the useful features in ZS that I use extensively, and not found the equivalent in any other IDE.
Ian.H wrote: | I think one of the biggest strengths of PhpED is the debugger. Personally I found ZS a convoluted royal PITA. It has some nice features that I would like to see in PhpED (refactoring as my primary for example) but I've been pretty happy with PhpED over the years, both for my Smarty projects (some being 5000+ files) and more recently, ZF projects. It's not perfect, but then nothing is.. but I'd definitely run the course of the trial and see how you get on. |
|
|
|
| | |
| Re: trying out PhpED and have a few questions. | |
Joined: 06 Jul 2009 |
Posts: 72 |
|
|
|
Posted: Wed Nov 30, 2011 3:41 am |
|
|
|
|
|
Quote: | Ian.H wrote: |
There's a 'Mapping' tab in the project prefs where you can set up path definitions. |
That didn't seem to solve my problem. The issue I ran into was in the new project wizard. It asks for Document Root, not Application Root. Then it automatically creates your project based on document root, which, again, isn't application root. If you select the application root, the project tests all fail because, again, doc root != app root. |
I'd have to look at this further as it's not a tab I usually change. For me, my project root is (for a ZF project) the parent to 'application', 'public' etc.. and this gets uploaded to my dev server at the other end of my room or a client's remote server via SFTP, which is then mapped to the likes of '/www/someproject'.
Quote: | Ian.H wrote: | Copying a file is a simply case of drag and dropping a file in the project tree. Moving can also be accomplished this way too if the Ctrl key is held down during the drag n drop process. |
Oooooh! So, it's backwards from what I had expected. I looked for copy/paste in the Edit menu (grayed out). And I tried cntl-drag and it kept saying 'Move'. And to me, just drag/dropping is move (always had been in any Explorer and many other places). PhpED went a little backwards here.... oh boy, so that means when I need to move files, I'm going to get confused. |
Indeed! IIRC, this was brought up once or twice a fair while ago too. I'm in the same mindset as yourself.. drag n drop == move, key+drag n drop == $somethingelse (copy in this case)... but it's something I've got used to. It does popup a tooltip when you start performing the action, so it's easy to see if you're doing the wrong one.. but definitely one to make you think about to start with.
guice wrote: | Ah ha! Found the problem. JS highlighting isn't obvious! I changed keywords to blue and look at that, it does highly JS. Sorry. My bad there. |
IIRC, I found the same too. The JS highlighting is very "bland". I went through and made it more PHP-esque a long time ago to help with both the initial highlighting factor and familiarity.
Quote: | Ian.H wrote: | You can import / create multiple projects within a workspace and work on the files simultaneously. Not sure if you can force 2 complete IDE instances.. but you can right-click on an open tab and set to 'Floating' which gives you an MDI-style application meaning that you could edit 2 files side-by-side. |
That would suit my immediate needs. Although, I'd love some function to "MDI" a full project. I just need my old-code project in a different window for reference when refactoring. |
In the PhpED Manual (Help Menu->PhpED Manual).. the 'Tips -> FAQ' section offers: The following is the list of the parameters used by PhpED: --mi - allow multiple instances. Again, not quite MDI.. but would definitely enable 2 IDE instances which might be closer to what you're looking for?
Quote: | Oh, and it's perspective in ZS. Perspective are very handle when managing SVN -- I can hide all my code, and just show the repository, history, and windows releated to SVN. |
Thanks for the clarification on 'perspectives'. I guess I've got used to using the TortoiseSVN "interface" for repo access etc.. and not very used to the ZS IDE. I can definitely see the benefits of being able to access SVN directly like ZS does (it's actually quite a commonly asked question on here IIRC) but just something that I got used to I guess from using SVN outside of PhpED anyway for other purposes.
Quote: | Ian.H wrote: | guice wrote: | [*] Is there a way to enforce variable types? ZS allowed the following syntax /* @var $res \Models\Cost */ to let me force $res to that object type. It's useful in instances where you have an Iterator object, and you need to tell your IDE what class the variable is: $result is \Models\ResultSet (implements Iterator); foreach ( $results as $res ) { ... } $res is of type \Models\Cost |
Not sure on this one. |
Would be useful. It's one of the useful features in ZS that I use extensively, and not found the equivalent in any other IDE. |
Could add this to the Feature Requests forum below.. what you don't ask for...........
Quote: | Like you said, nothing's perfect. I've put up with ZS for a while. It has a lot of nice little features within it that many other IDEs don't share: refactoring, code templates, variable enforcement. I'm just getting annoyed they keep expecting people to pay $200 for a performance patch (I don't - I get free versions, but still the jest of it). |
PhpED has code templates too.. something I find quite useful myself.
Also, you can extend certain functionality as such, with PHP scripts... so in answer to your other post above, whilst it might not be built in, it wouldn't be too difficult to write a PHP script to auto-generate the setters and getters for properties and add that as a menu item under the 'tools' menu. Check the PhpED Manual under the 'NuSphere PhpED Settings -> Integration with 3-rd party tools settings' section. First paragraph has a 'please refer to this topic' link for a couple of basic examples.. and there's an integration forum below too that might be useful for some further info.
Downside.. you need to write the code to do it yourself... upside.. will only have to do it once and if you do find you like PhpED.. then you'll have the functionality you're after.
Cheers..
Ian
|
|
|
| | |
|
| | |
Site Admin
Joined: 13 Jul 2003 |
Posts: 8344 |
|
|
|
Posted: Thu Dec 01, 2011 1:24 am |
|
|
|
|
|
while it's correct to support only correct syntax , we added support for the incorrect too. It makes sense for those people who has large codebase with typehints formed in this way.
See "Recognize xDoc in single-asterisk comments" in project properties (and global one in Tools->Settings->Code Insight).
So it recognizes PHPDOC and JSDOC in simple comments in php and js files respectively if the option is turned on.
|
_________________ The PHP IDE team
|
|
| | |
Joined: 28 Nov 2011 |
Posts: 13 |
|
|
|
Posted: Thu Dec 01, 2011 10:44 am |
|
|
|
|
|
You know, I think somewhere along the line, ZS added support for single asterisk version. I seem to recall getting caught by this in the past, too, having to add a second asterisk. But now that you mention it, I have been using single version everywhere, and it worked. Weird. I'm all for proper format. Stupid IDE adding in support for improper version, having me litter my company's code with this format. Okay, well, I'll start using the proper version then! Thanks.
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT - 5 Hours
Page 1 of 1
|
|
|
| |