Zend Studio is a convenient environment to code in PHP, which is why many Drupal developers are using it. But some settings are necessary to ease its use, due to the specific extensions Drupal uses.
Recognizing Drupal components within the Studio IDE
First things first, chances are you've already noticed Zend Studio didn't consider Drupal .module, .inc, or .theme files to be "Web documents", or even actual PHP, and found how to configure it for them. If you haven't, it's real simple (example given for Zend Studio 5.0.0) :
- Start Zend Studio
- Open the
Tools→Preferences dialog - Choose the
File Typestab - Choose the
PHP filesin the top left list - Click
Addon the top right button, near theFile type extensionlist - Add each extension needed by Drupal:
module,inc,engine,theme, one at a time. Do not include the dot before the extension - That's it ! You now have access to the full features of the Zend Studio IDE on Drupal components
Generating PHPDocumentor documentation for Drupal components
Zend Studio 5.x comes bundled with PHPDocumentor and some integration work done. while PHPDocumentor is not the standard documentation tool for Drupal, which uses DOxygen instead, it is still very convenient, notably as most tags are compatible between the two systems anyway.
However, Studio does not reconfigure the PHPDocumentor file types, so when you try and generate documentation using Zend Studio's Tools → PHPDocumentor wizard, you'll stumble on this error:
This time the workaround is not within Zend Studio itself: although Zend could have integrated this setting into PHPdocumentor, they didn't do it (yet ?) in version 5.0.0. The setting is located in file <studio directory>/bin/phpdocumentor/phpDocumentor.ini. You can just as well edit it within the IDE while it's up. You'll find it's a vanilla .ini file, with the files to be processed as PHP source listed in a _phpDocumentor_phpfile_exts section:
(...skip beginning of file...) [_phpDocumentor_phpfile_exts] php php3 php4 phtml (...skip rest of file...)
All it takes is to add the extensions we need:
(...skip beginning of file...) [_phpDocumentor_phpfile_exts] php php3 php4 phtml engine inc module theme (...skip rest of file...)
That's it ! You can now generate docs for your Drupal code from within Zend Studio. Don't forget to add the comments into your code, now !



Cool, heres a more general
Recognizing Drupal components with Zend Studio for Eclipse
Follow the previous steps, to recognizing Drupal components with Zend Studio for Eclipse you can:
1- Open the Window → Preferences dialog
2- Choose General → Content Types on left list
3- Choose Text → PHP Content Type in the top rigth list
4- Click Add on the top right button, near the File type extension list
5- Add each extension needed by Drupal: *.module, *.engine, *.theme, one at a time.
Regards