NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
trying out PhpED and have a few questions.


Joined: 28 Nov 2011
Posts: 13
Reply with quote
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:

  1. A way to differentiate Application root and Document Root? In my apps: Application Root != Apache Document Root.
  2. How do I copy a file? I want to copy, say, Base.php from one folder to another. Then edit it, changing the namespace.
  3. 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).
  4. Related note: variable refactor renaming? Change $this->row to $this->rows by renaming protected $row?
  5. 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.
  6. 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.
  7. 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.
  8. 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.
View user's profileFind all posts by guiceSend private message
Re: trying out PhpED and have a few questions.


Joined: 06 Jul 2009
Posts: 72
Reply with quote
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
View user's profileFind all posts by Ian.HSend private message
Re: trying out PhpED and have a few questions.


Joined: 28 Nov 2011
Posts: 13
Reply with quote
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.
View user's profileFind all posts by guiceSend private message


Joined: 28 Nov 2011
Posts: 13
Reply with quote
PhpED needs code generation function ... I've just created a model class that has over 60 properties. In ZS, I can go to source and auto-generate getters/setters for each one of these properties. Not so much here! Hmm ... I'm tempted to fire up ZS8 just so I can do this.
View user's profileFind all posts by guiceSend private message
Re: trying out PhpED and have a few questions.


Joined: 06 Jul 2009
Posts: 72
Reply with quote
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........... Smile


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
View user's profileFind all posts by Ian.HSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
The use of /* @var $res \Models\Cost */ looks like PHPDoc, which is supported by PhpED but the syntax is actually /** @var $res \Models\Cost */ with a /** at the start. If ZS accepts /* then it is technically incorrect.

PhpED supports multiple instances, but I found that only one of those instances will work for debugging. So if you start debugging the second project then it will do the debug within the first project and doesn't generally work as desired.
View user's profileFind all posts by plugnplaySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
while it's correct to support only correct syntax Smile, 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
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Nov 2011
Posts: 13
Reply with quote
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.
View user's profileFind all posts by guiceSend private message
trying out PhpED and have a few questions.
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  

  
  
 Reply to topic