My search for a good PHP IDE never stops 😉 My choice was Zend Studio until recently. But Zend Studio is not free and it’s free analogue – PDT – lacks some features like refactoring (PDT is also mainly developed by Zend, so, I think, Zend will always keep it low to prevent competition with Zend Studio). Also, it is monstrous (More than 300Mb installer) and it definitely lacks good Symfony support.
Recently I came across NetBeans, which is now free and developed by Sun. Sun seem to abandon all own IDE projects in favour of NetBeans, so this is a somehow strong foundation.
Oh… 25Mb installer only for PHP version 😉 And… it is easy to use. Very. I would like to guide you through the creation of new symfony project in NetBeans.
You need Symfony to be installed on your PC before we proceed.
NetBeans can be downloaded from this page. Choose PHP version. It already includes Symfony plugin. Run downloaded installer and wait for completion. Start IDE. Select File -> New Project. Choose PHP Application. You will be guided through a series of steps to configure your project.
On the step 4, it is recommended to click Options link and check if Symfony settings for the project are configured correctly. NetBeans will try to automatically find Symfony files if you installed it using PEAR installer (it automatically adds Symfony binary to search path).
Press finish button. IDE will now execute Symfony task to create a new project with all the settings you entered.
Every symfony task can be executed from IDE by right-clicking project root.
Let’s now create a new module.
Now one more important trick. Navigate inside the action, type “$this->” on the new line and wait a little for code completion to be invoked. You can see now, that autocompletion is broken because IDE doesn’t know anything about Symfony classes. But this can be easily corrected.
Invoke Project Properties by right-clicking project root.
And add your Symfony source folder to the list
Now wait a little while NetBeans parses all Symfony classes.
And now you can reinvoke code completion and see, that everything is allright:
Charming, isn’t it?
NetBeans has almost everything you need. And if it doesn’t have something, plugin community, probably, have: http://plugins.netbeans.org/PluginPortal/