Feeds

NetBeans extension makes simple work of PHP

Preview in review

3 Big data security analytics techniques

Arriving with the NetBeans 6.1 release last week was the NetBeans IDE Early Access for PHP. This provides a complete PHP integrated development environment hosted in NetBeans, re-using the infrastructure NetBeans has already employed for Java and Ruby.

Having walked through the main NetBeans IDE, I thought it worth looking inside the PHP update to see what it offers one of today's most popular languages.

Available as a separate download via the NetBeans site, the early access installs separately from any existing installation of the IDE, making it safe to play with without risking any productive development environment.

Installation is straightforward on the main supported platforms - Windows, Linux, Solaris and Mac OS X - but there are some entry level requirements to make it useful as a PHP environment. You'll need a working installation of PHP 5.x, a PHP debugger (XDebug is strongly recommended), a web server (Apache) and a database server (MySQL gets the most support out of the box).

If you already do some PHP development you'll have all of this in place, if not then you'll need to get it all up and running before you can do anything useful. For those who like things easy, the best bet is to download a single package to get the works, such as XAMPP for Windows or Linux.

Click and create

Once everything is in place, creating a PHP project is as simple as selecting File > New Project or clicking on the New Project button on the toolbar. The New Project dialog box gives you the chance to enter the directory for your source files (such as PHP, XHTML and CSS), the directory on the web server where you'll deploy these files, and the URL for the application. Along with these, you also get the option to create an index.php file as the entry point of your application.

As you'd expect from an IDE all of the editor functionality is in place with PHP syntax highlighting, code completion, integrated help, error flagging and so on.

The code completion is context sensitive, so entering $ inside the PHP directive gives you access to the run-time variables (such as $_SERVER). Anywhere else on the page, the $ symbol is just that. You also get drag and drop from a palette of HTML elements such as tables and forms. Code folding, formatting and ease of navigation - the kinds of features you'd expect from a PHP editor - are also present and correct.

There's more to building an application than cutting code, though. On the database and server side of things there are some nice NetBeans features. While NetBeans includes support for a number of different servers and databases, it's MySQL that gets pride of place - no big surprise given Sun Microsystems now owns MySQL. This makes it easy to hook up to a MySQL database server so that you can interact directly with the database for your PHP app.

You can also create a file with a .sql extension (though for some reason there's no menu option to create a SQL file) and use that to run queries that define and/or change your database. For those used to the Rails set-up/tear down way of working you can pretty much achieve the same using these text files to define your database during development. When you're debugging, meanwhile, you can even craft ad-hoc queries and look at the grids of data that you get back.

Other supported file types include CSS, XHTML, XML and JavaScript. Again you get the usual range of editor support functions such as color coding and so on. In the case of CSS support there is also a style builder with preview, making it straightforward to put together the styles for your application. The JavaScript side of things is also very well handled - support for dynamic languages and scripting in general is, after all, a key component of NetBeans.

One of the other benefits that comes for free is version control - with support for CVS, Subversion and now Mercurial version control systems.

Missing pieces

Having said all this, it pays to remember we're dealing with an early access release, so there are still some rough edges while some nice-to-have features are still missing. An example of the former is control of the browser, which could be better. Running your application fires up whatever browser you've defined as your default, but for those who want to test with different browsers from within their IDE a degree of choice would be nice. On the latter, for the moment, there's little in the way of refactoring support. This would be something to look for in a finished product.

Overall, though, this is another big step forward for NetBeans in the march towards being the IDE of choice for dynamic languages and scripting. While there is competition out there, solid support for Ruby, JavaScript and - now - PHP, combined with the fact improved support for Jython is on the horizon, means NetBeans is showing the most pace.®

Top three mobile application threats

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Inside the Hekaton: SQL Server 2014's database engine deconstructed
Nadella's database sqares the circle of cheap memory vs speed
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
IRS boss on XP migration: 'Classic fix the airplane while you're flying it attempt'
Plus: Condoleezza Rice at Dropbox 'maybe she can find ... weapons of mass destruction'
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
New Facebook phone app allows you to stalk your mates
Nearby Friends feature goes live in a few weeks
prev story

Whitepapers

Top three mobile application threats
Learn about three of the top mobile application security threats facing businesses today and recommendations on how to mitigate the risk.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
SANS - Survey on application security programs
In this whitepaper learn about the state of application security programs and practices of 488 surveyed respondents, and discover how mature and effective these programs are.