This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature: PHP

Increase PHP programming productivity with Zend Studio

By Peter J. Manis on February 06, 2007 (8:00:00 AM)

Share    Print    Comments   

Looking for an integrated development environment (IDE) for your PHP coding? Zend Studio, which launched its latest version 5.5 in December, offers an impressive feature list that can increase the productivity of even novice programmers.

Zend Studio is a Java application, which means it can run on any OS that supports Java. Many Java applications tend to run slowly, but I noticed no major performance difference in Zend Studio compared to similar applications. By default Zend Studio is configured to use the look and feel of your current operating system's theme, making it easy on the eyes.

When you first install Zend Studio you must select the PHP version you will be developing for most often. Your selection will affect the code completion, syntax highlighting, local debugging, and other version-specific features. Unfortunately you can't override this selection on a per-file basis, but you can change the version at a later date in the Preferences dialog under the Desktop tab.

The preferences dialog includes an incredible number of options for customizing Zend Studio. For instance, under its Editing tab are common options such as tab size, replacing tabs with spaces, strip trailing spaces, and Windows or Unix file format, along with options for code folding, character highlighting, and auto-completion.

Code folding, in which certain portions of a program are hidden from view, is a great feature, but many applications lack the option to select which portions of code will be automatically collapsed on loan; it was always all or none. In the latest version, Zend Studio gives you the choice of what should auto-collapse on load. When you are working with an unfamiliar script, code folding combined with the ability to go directly to a function definition in another file can greatly improve your ability to decipher what is really happening.

That still leaves a hole when sloppy code comes into play. Highlighting, sometimes known as brace matching, attempts to improve readability by highlighting the opening and closing characters of control structures, quotes, and parenthesis. You are given the option to select which characters you would like to have highlighted, but the software does not give you the option to highlight the code between the characters.

Zend's Studio allows you to select which characters, tags, and structures will be automatically closed after you write the opening portion of code. Personally, I don't like having my quotes or HTML tags automatically closed, but I do prefer to auto-complete parenthesis, brackets, and braces.

Furthermore, under Code Completion, you can disable or enable the display of functions, objects, classes, and variables in the current file, including files that are in the project or in included files.

Figure 1
Code completion dropdown and reference - click to enlarge
This screenshot shows how Zend Studio handles code completion. Here, $pmail is referencing the PHPMailer class, so anything involving $pmail will display classes, functions, and variables related to PHPMailer. It will show the class and the function or variable along with the arguments and their type. If the function, class, or variable has been properly documented, the drop-down box will be followed with a box detailing the parameters of the function, a description, and any additional information provided in the documentation. All of these classes, functions, and variables are also available for viewing in the Inspector box shown on the left.

In addition to these useful features, Zend Studio offers a tabbed interface for files, a WSDL generator, full support for PHP Documentor, and powerful debugging capabilities.

Zend Studio offers templates to simplify reusing common blocks of code. When you are inside a file you simply type a template name and press the Tab key in order to insert the contents of that template at the cursor position of the file. Within the template you may have designated variables. After the template has been inserted the first variable should be highlighted and have a red box around it. When you start typing, the variable name will be replaced with your text. You can then press Tab again to move to the next section. Templates can help save you from copying and pasting large blocks of code or editing multiple variables within code snippets.

Figure 2
Source control and revision diff - click to enlarge
Zend Studio integrates Subversion and CVS for source control. On the left of this figure you can see the context menu that is displayed when you right-click a file. If the file has been checked out from a repository, you will have the Subversion (or CVS) menu at the bottom, and if that file was modified, the Commit option will be enabled. When you run a commit command, the software will display a dialog giving you the option to enter a log message along with additional commit options. Figure 2 also shows us how Zend displays the Diff viewer for Subversion.

Zend Studio also incorporates a simple database browser and the ability to use an FTP server as if it were a local hard drive. On the File menu you can add an FTP, SFTP, or FTP over SSL connection by clicking Add FTP Server. After you define it, the FTP server will show up in your File Manager under the File System tab and will operate as if it were a local hard drive. When you save a file to it, Zend Studio will automatically log in to the FTP server and overwrite the file on the server.

Two final noteworthy features are the Code Snippet gallery and the ability to clone the view of a file. The Zend Web site has a developer section displaying snippets contributed by users from around the world. These snippets have been integrated into Zend Studio via a snippet gallery that directly interacts with the Web site. Under the Edit menu, select Show Snippets and update the snippet file. You will then have a large repository of snippets to insert in your scripts and the ability to add your favorite snippets for future use.

Figure 3
Snippet gallery and clone view - click to enlarge
Clone View allows you to edit the same file in multiple windows, keeping them in sync at all times, eliminating the need to scroll back and forth from section to section. To clone a file, right-click on the editor window of an open file and select Clone View. Any text added or removed in one view is automatically updated in the other.

Zend Studio is a feature rich IDE with the added benefit of being cross platform. I hope you will download the trial and experience these features for yourself.

Peter Manis has been a PHP developer for four years and has worked with a variety of PHP IDEs.

Peter Manis has been developing PHP applications for more than four years and experiments with a number of PHP IDEs.

Share    Print    Comments   

Comments

on Increase PHP programming productivity with Zend Studio

Note: Comments are owned by the poster. We are not responsible for their content.

Zend Studio

Posted by: Anonymous Coward on February 07, 2007 10:52 PM
Zend Studio is proprietary software.

<a href="http://en.wikipedia.org/wiki/Zend_Studio" title="wikipedia.org">http://en.wikipedia.org/wiki/Zend_Studio</a wikipedia.org>

#

It's nice, but not anything special.

Posted by: Anonymous Coward on February 08, 2007 03:56 AM
I use Zend Studio every day. It's not very well put together. It should be project based. You mention that you have to define a global setting for the php version - that should be defined by the current project you have open or by the project the current file belongs to. The same goes for ftp servers - they're all defined globally - that should be defined within the scope of the project.

The UI sucks in general because you can't hide unused toolbars. Everything is always in the way.

Yes, it's a java app and it's reasonably fast, but it always has choke points. It'll freeze up and you can't do anything for a minute while it does whatever it thinks needs doing. This sucks big time because it almost always comes while writing code - like it decides to rebuild the code completion database in the middle of working. It blocks the whole UI and is extremely irritating. Because of that, I've taken to using vim more than ZS.

It's pretty good, but there's a lot of room for improvement. Keep in mind that it's a commercial app and you don't get even minor version updates without a support contract. If there's a serious bug, chip up the cash to get the next minor release (which are rare) or the next major release.

#

Re:It's nice, but not anything special.

Posted by: Anonymous Coward on February 08, 2007 07:28 AM
Mhh, there's a lot of mud-throwing going on here. I use it every day too and I haven't got the complaints the user above me has.

I know you can define a php version for a project (and not only global).

And toolbars can be hidden. And the freezing only happens when I paste a lot of text (more than 100 characters) in the find dialog.

I have to agree with cash-bug. You have to pay everytime Zend fixes as bug,

#

Re:It's nice, but not anything special.

Posted by: Anonymous Coward on February 13, 2007 02:26 PM
It's not mud-throwing, it's fact.

You can't define a php version for a project. Look under Project -> Project Properties. Nope. It's a pathetic excuse for a project structure.

Try to hide the main toolbar - the one with the ugly icons. Buttons New File, Open File, Copy, Cut, paste, etc. Try to hide the Editor/Browser tab toolbar. I challenge you to do either.

I like it enough to use it, but it has many short-comings. I also don't really like these reviews on linux.com that are nothing more than a sales pitch masquerading as an unbiased review.<nobr> <wbr></nobr>:-)

#

The Worst Editor Ever

Posted by: Anonymous Coward on May 15, 2007 09:34 PM
Honestly, I have no idea why people scramble to shell out the money for this thing. It hands for five minutes sometimes when I click "Save as..." and crashed multiple times when I first started using it. It also takes a good minute and a half to load, but that might just be because it's a Java app.

The code completion is the only feature I can think of off hand that's good. And the implementation is just annoying. I'd rather just search the PHP manual when I need it.

One thing I like about ZDE, however, is that it was what finally pushed me over the edge and got me to learn Vim.

#

Re: The Worst Editor Ever

Posted by: Anonymous [ip: 84.232.166.64] on August 16, 2007 08:43 PM
for all you think you used this software enough... I have two good points for you ...

1. technology advances fast ... with it, new features arise ... so stop complaining about those hangs and buy a good computer ... it never did hang to me, in fact for me it's the fastest web programming tool .
2. use linux :P

The only good point I've read here was the project related one ... the rest were only pathetic excuses from people that sometimes just can't see a need for a change ...

About the money part : no comment ...

Good luck !

#

Increase PHP programming productivity with Zend Studio

Posted by: Anonymous [ip: 202.93.36.89] on February 09, 2008 02:10 AM
I like Zend Studio because it can debug my php application.
and i like firefox/IE toolbar from Zend.

check new zend studio neon. it based on eclipse.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya