beta it republik » Articles

Articles

Untitled Document
Wednesday, 11 June 2008 | Article

Review of NuSphere’s PhpED 4.5

It’s been a while since we’ve reviewed NuSphere’s PHP IDE, PhpED. The latest release of this IDE, PhpED v4.5, boasts plenty of new features for PHP coders such as an integrated PHP debugger, instant browser preview and numerous helpful tools to speed up development. There are tools embedded in the software that help improve the quality of your code, and to help you decipher code inherited from someone else. In this article we take an in-depth look at what PhpED has to offer, as well as some things that might be nice to see included in the future.


Introduction
I’ll admit it. I’m old school. I always had a difficult time justifying a purchase for something like an Integrated Development Environment (IDE), especially when the money would be coming out of my pocket and not from a large corporation’s. Reviewing NuSphere’s latest release is making me rethink my ways. There are so many timesaving elements in this software it’s liable to pay for itself numerous times over. As well as saving time, anything that saves me typing (thus effectively reducing the probability of errors) is definitely something worth giving a second look. As we’ll see, however, this software offers so much more. A free trial of PhpED can be downloaded from the NuSphere web site.

So what is the difference between an IDE and a simple text editor? Functionality. Text editors deal strictly with the text you’re typing in. The really good ones might try to anticipate what you’re typing and offer suggestions such as code completion (akin to a spellchecker in a word processing document that tries to “guess” what word you meant to insert) or tools such as syntax highlighting to help you keep track of what you’re typing. However, when you think of a full “development environment,” you realize that it encompasses so much more than just typing in lines of code. It includes the databases you need to access to get the information you need (an extensive list of databases are compatible with PhpED). It includes any shell access you’ll need such as Telnet and SSH (both of which are integrated into the PhpED software). Your environment may also include more complex tools such as validation of your code against standards, quick access to variable, constant, class or function names, and running a debugger or a profiler that helps you work out errors or bottlenecks in your code. An IDE, therefore, not only helps you type faster, but it also helps you become a better coder. Because the operative word here is ‘integrated’ we see many of these things under one roof in the PhpED software.

Installation
Installing this software was a breeze and took a maximum of two to three minutes. A nice feature is that you’re given the choice of installing PHP4 or PHP 5, or both. The software is self-contained, so it will not mess with your current php.ini settings of any previous PHP installations you may have going.

My Favorite Time Savers
This software is chock full of time savers, from numerous customizable keyboard shortcuts to code completion tooltips. I’ve picked a few of my favorite ones, some of which are common in other editors or IDEs, and some are not so common. This is by no means a comprehensive list of what is under the umbrella of PhpED.

Standard fare for text editors is of course included in the PhpEd software. Features like syntax highlighting, line numbering, word wrap, indenting blocks of code at once, and search and replace are all part of the software. The nice thing about PhpEd is the way these options are presented to us. Most are presented as buttons right next to your working file’s space on the screen, which makes it very handy for the developer. One of these buttons represents a function called “screen split” that lets you view different blocks of lines of the same file.


Likewise, if you use a lot of HEREDOC in your code, or if you are getting an unexplained “Headers already sent” error, you may want to turn on the ‘show hidden characters’ feature, which identifies every space and line return. I can think of more than one occasion where an error came down to a simple “space character”, and this feature would have saved me a lot of headaches over something so darned trivial.

I’m a big fan of the HTML shortcuts, because I find typing in HTML tedious at best. The hex code insert is a nice feature seen in other software packages, that allows you to select a color from the standard palette and the hex code is automatically inserted into your HTML document. Likewise, the automatic inclusion of HTML tags such as title, meta tags and keywords are generated based on a few clicks, as well as inserting forms and form elements, and images. Then if you find yourself actually typing in HTML, there is an auto-completion feature for automatically inserting closing tags for you. You can enable this by default in your “Settings” or you can use the keyboard shortcut, Ctrl-Shift-C whenever you need it.

Code completion is another nice feature I use often. With a minimum of three characters (which you can change to a different minimum if you like), each function you begin to type will display a pop-up list of suggestions and the correct syntax to be used with that function, saving you not only typing time, but also quick checks to the PHP Manual.

Like an ongoing spellchecker that automatically identifies a misspelled word in a document as you type, there is a built in auto-debugger function to this IDE that immediately identifies parse errors.

Drag-N-Drop lets you drag a file over to the file being actively edited and drop results in an instant hyperlink if you are creating an HTML file or an include() if you are creating a PHP file. Again, this is another nice feature for lazy people like me.

The Code Explorer function gives you access to all the functions, classes, constants and variables in the entire project at one glance. Hovering your mouse over one shows the parameters defined, and which file and line number it appears on. Doubleclicking on the item takes you directly to the place in that file where it is defined. I found this especially helpful when you are deciphering other people’s code, and you are unfamiliar with the file and the file structure. You can zoom directly to the element you need to find, instead of surfing through hundreds of lines of code, and numerous files.

The find and replace function spans your entire project, or collection of projects, making it easy for you to update many files at one time, instead of taking each one separately. As well, this functionality is taken even further by including PCRE regular expressions within your search criteria and the text you’re replacing. You can also jump to a particular line number with the ‘Goto Line’ function. One more thing it will find for you is the “matching bracket” to the section of code you’re working on—a very helpful feature when you are working with chunks of code and nested functions or if statements. Another extremely helpful thing is to use the ‘Find Declaration’ function.

If you are currently in a document and you need to know where a constant, variable, class or function was originally created, simply right click on the element, choose ‘Find Declaration’ and it will immediately take you to the origin in whatever file it happens to appear. This is an extremely timesaving function, especially when debugging or reading other people’s code. A nice feature is the ability to quickly view the file as seen from Internet Explorer, through the browser preview, which pops up as another tab you can flip to. You can also alter the screen size to immediately see what effect design changes have on different screen resolutions, such as 640x480 all the way up to 1280x1024, or a custom size.

My Favorite Quality Enhancers
Saving typing time is great, and automatic functions that insert things for you will of course help reduce human error. However, because this is a true IDE, there are certain things that help you make your overall project (or collection of files) better.

phpDocumentor, if you aren’t familiar with it, is a tool that lets you easily create code documentation for your PHP files. As long as you follow the phpDocumentor coding standards, it will generate the documentation automatically. In PhpED, the phpDocumentor integration allows you to generate code documentation from within the PhpED software, with a click. For more information about coding to the phpDocumentor
standards to enable this function, visit the phpDocumentor web site. Having nicely formatted documents to go along with your code is a wonderful thing to pass along to your client or future coders, and because of the way this is integrated into the software it doesn’t take much effort on your part.

Easy indenting and matching of brackets help you make your code pretty, which is nice for those of us that come from the ‘broken source’ school of coding (that is, type it all in a big mish-mash of line spaces and indents and by all means don’t be consistent about anything). This is also helpful for taking other people’s code and sprucing it up a bit to make it easier to read.

I’ve been known to make an error or two in my development, and, thankfully, this incredibly rich debugger does a great job of helping me retrace my steps. When the debugger is running, it will stop on every error, and point you to the line in question. It will also give you the variables being used and their values, as well as keep a log of every action you have taken so you can easily remember what you did a few steps ago. Incidentally, the activity log also keeps track of what time the action occurred, so you have a record of how much time you have spent on a project (great for freelancers!).

Even if your file parses correctly, there are many times when the output isn’t what you expected. Of course, the software lets you step into each line one-by-one so you can easily pinpoint where things go amiss. You can also step over a problem area (no more commenting and uncommenting) or step out of the file altogether. Like any good debugger, you can insert breakpoints along the way to only debug the part of the code that is important at the time.

The profiler lets you know how long your code takes to run, and will identify potential bottlenecks or inefficient lines by module or file. This would be extremely helpful for complex projects that are particularly concerned about scalability. I took my noname1.php5 file and changed it a bit to do a little comparison. My new file looks like this:

<?php
echo “Hello Master Foo.”;
echo(“Hello, Young One.”);
print “What’s new?”;
print(“These Jedi robes are really starting to chafe.”)
?>



HTML and CSS Validators let you quickly validate your code with a click, and offer suggestions for improving your code if it doesn’t quite cut it. As well, you can instantly change the case of your tags, Tidy your HTML, or apply code beautifiers such as PolyStyle. Again, all these things are done with a click, and make your code (or someone else’s) much cleaner and easier to read.


The Extensive Help Library
I really liked the fact that there is a lot of third-party documentation integrated within the confines of the software. Besides extensive help for the software itself (which includes the NuSphere manual and links to online help), going to the ‘help’ dropdown produces PostgreSQL documentation, the PHP manual, MySQL documentation, a JScript language reference, HTML specifications and reference materials, CVS documentation, a guide to CSS, and help on NuSOAP. Note that this information is integrated within the environment so you don’t have to go anywhere else. It is right there at your fingertips. As well, the entire collection of documents is searchable with one click—a very nice feature. Although it’s not specifically available as a ‘dropdown’ function, there is also a nice reference guide for PCRE regular expression syntax that is embedded within the main PhpED manual, and thus included in the search. Also, you can add your own documentation resources to customize the ‘Help’ area even further.

Future Wish List
Now that we all know what a lazy, sloppy coder I am, I guess it’s safe to say I’m also a dreamer. Things I would love to see included in future releases of PhpED would be:
  • The inclusion of subversion not just CVS
  • JavaScript Help Documentation integration
  • Ajax Help Documentation integration
  • Other browsers besides IE in the Preview mode
  • HTMLArea or something similar
  • Integration with PEAR/PECL, either via installation of packages or list and descriptions of what packages are available for download

Some of these things may or may not be in the works at the NuSphere headquarters.

Summing it Up
If you asked me what I didn’t like about the software, the answer would be ‘not much.’ The only criticism I might offer is that the newest version is only available for Windows platforms (Linux users are stuck with v3.3). Otherwise, I felt as if PhpED was comfortable to work with in its default user mode, but any picayune detail that bothered me could easily be changed to suit my own coding style and the layout I liked best.

There are numerous other functions that I didn’t explore in this review, which I also played with and found quite useful (such as the SmartSync feature which automatically synchronizes files on your system with a remote server, and the database client that gives you direct access to your tables and the ability to run SQL statements from within the PhpED umbrella). There are features attuned to the more advanced developer, such as the SOAP, the debugging, and the profiling systems to name a few, but even beginner coders will find this software extremely helpful. This package is as competitive with any other IDE that I’ve seen, and should definitely be on your ‘short list’ if you’re in the market. They also offer a free 14-day fully functional trial. So you really have no reason not to go download a copy today and give it a whirl.


About the Author

Elizabeth Naramore has been working in web development since 1997, and PHP specifically since 2002. Although her main focus is in e-commerce, she has also co-authored several PHP related titles. Besides web development, Elizabeth also teaches e-commerce and writes a weekly PHP news column for PHPBuilder. com. She also enjoys being an active part of the mighty OINKPUG (Ohio, Indiana, Northern Kentucky PHP Users Group). She lives in Cincinnati, Ohio, with her husband and two children.


   Related Links
http://www.nusphere.com
http://www.phpdoc.org/


Comment

Name:

Comment:

Captcha Verification !
captcha_image