Configuring the Zend Studio PHPDocumentor extension for PHP-GTK

Submitted by Frederic Marand on

Zend Studio is a convenient environment to code in PHP, even though it is not currently possible to use it for integrated debugging of PHP-GTK code: its php completion and file management, and phpdoc integration make it very useful for the PHP-GTK environment too. However some settings are necessary to ease its use, due to the specific extensions typically used by PHP-GTK programs: phpw files for applications, and glade / gladep for Glade files storing UIs.

Recognizing PHP-GTK files within the Studio IDE

First things first, chances are you've already noticed Zend Studio didn't consider the frequently used .phpw 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.2.0) :

  1. Start Zend Studio
  2. Open the ToolsPreferences dialog
  3. Choose the File Types tab
  4. Choose the PHP files in the top left list
  5. Click Add on the top right button, near the File type extension list
  6. Add the extensions needed by PHP-GTK: phpw within this category. Do not include the dot before the extension.
  7. Continue with the XML file section, adding gladeand gladep (glade project files).
  8. That's it ! You now have access to the full features of the Zend Studio IDE on Drupal components

Generating PHPDocumentor documentation for PHP-GTK files

Zend Studio 5.x comes bundled with PHPDocumentor and some integration work done.

However, Studio does not reconfigure the PHPDocumentor file types from its internal preferences system, so when you try and generate documentation using Zend Studio's ToolsPHPDocumentor wizard, you'll stumble on this error:

PHPdocumentor: PHPW not a PHP File

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.2.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
phpw
(...skip rest of file...)

That's it ! You can now generate docs for your PHP-GTK code from within Zend Studio. Don't forget to add the tagged comments into your code, now !