Syntax Highlighting for Drupal .inc and module files in Dreamweaver

I'm using dreamweaver as IDE for coding PHP and use inc files for some Drupal modules. By default Deamweaver does not highlight inc files but can be made to highlight syntax for such files. I also did the same for Drupal module extention. Module files are PHP but use the file extension .module, which Dreamweaver does not recognize as PHP code, so we'll register the .module and .inc file extensions as the PHP document type.

To do this:

Open c:\Program Files\Macromedia\Dreamweaver\Configuration\DocumentTypes\MMDocumentTypes.xml

Look for winfileextension="php,php3" or macfileextension="php,php3" if you're on a mac and simply add inc and module to the list:

winfileextension="php,php3,module,inc"

Save it, and restart Dreamweaver and you should be good to go.

For more info see:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16410&slice...

It works well.. very useful!

CGA

Anonymous | Thu, 12/20/2007 - 14:35

Thanks for explaining this so clearly. One important note about INC files on a web server: make sure you disable delivery. A user will see the entire file in plain text if they guess the URL.

You can also adjust your web server to parse INC the same as it does for PHP (or whatever you're using) but INC files tend to be incomplete so running it outside of a PHP file may cause undesirable effects.

Joe

Anonymous | Sun, 12/16/2007 - 05:45

Thanks.

Nice tip; well documented.

Have a good day.

John

Anonymous | Wed, 12/12/2007 - 05:48