Developing a Module on a Windows System

Unfortunately a lot of the writings you will find here on Drupal

Drupal

An open-source content management system that is used on this site and is taking over the world..org are geared towards LinuxA Unix variant that has become very popular. It has itself spawned numerous variants, although not all of those enjoy open-source status. (or its variants). I had to pore through those writings to come up with a technique to use on Windows that works for me. Hopefully these tips will help you too.

My Environment

As of this writing, I have eight development (test) sites on my PC that reflect the live sites that I develop or do primary maintenance on. They are set up in a multisite configuration.

I do my moduleAn add-on, or extension, to Drupal to provide additional functionality; written in PHP. development in my sites/all/modules directory. This allows all the sites to be exposed to the moduleAn add-on, or extension, to Drupal to provide additional functionality; written in PHP. so I can have different environments in which to test it. This can be important because not all modules play well with each other and what works in one siteA logically grouped set of content - also web site. may not in another.

Currently, I use DreamweaverAn application set that is designed to produce web sites and edit code. For some uses, it constitutes an IDE, in others it is inadequate for that. because I haven't had the time to learn a better IDEInteractive Deveopment Environment - a collection of tools or applications that allow a developer to produce, test, and document code. yet. [Please, someone step up and create a tutorial on EclipseAn Open Source application that provides the framework for an IDE. or something like it!] DreamweaverAn application set that is designed to produce web sites and edit code. For some uses, it constitutes an IDE, in others it is inadequate for that. is a horrible development tool for Drupal

Drupal

An open-source content management system that is used on this site and is taking over the world. (more on it later).

Why not Use Notepad or Wordpad?

You can. I do if I'm making a quick, small change. Many years ago I abandoned Notepad so I can't speak to it's current implementation; some people say it's better.

I use Wordpad for these quick changes. However, Wordpad has a nasty habit of moving the current line (with the cursor in it) to the top of the frame when you save it; this can be annoying. It also doesn't know PHPRecursive acronym for "PHP: Hypertext Preprocessor" - is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. so it doesn't color the code like an IDEInteractive Deveopment Environment - a collection of tools or applications that allow a developer to produce, test, and document code. (or even DreamweaverAn application set that is designed to produce web sites and edit code. For some uses, it constitutes an IDE, in others it is inadequate for that.) does.

Another disadvantage is no line numbering. Unless you never make a mistake (be honest now) and never have to refer to your Apache error log, something that tells you the line number is important for locating your errors.

I have had some people recommend UltraEdit and NotePad2.

BEFORE You Start Coding

Drupal

Drupal

An open-source content management system that is used on this site and is taking over the world. is constantly being improved. This means that, at any given time, there are at least 3 versions: a) the previous stable version (as of this writing, 4.7), b) the current stable version (5), and c) the next development version (6). It is probably going to be common practice that the version beyond that (7) will be at least in planning as well.

This means it would be a really good idea for you to do a little homework. There is a handbook section on Updating your modules. The Drupal

Drupal

An open-source content management system that is used on this site and is taking over the world. philosophy is to not carry "baggage" forward; this means that occasionally (usually) The new changes will "break" your moduleAn add-on, or extension, to Drupal to provide additional functionality; written in PHP.. Study that plans and announcements to see if there are things you can easily avoid now.

For example, D6 will eliminate the "db_num_rows" function. I had this all over my previously developed modules. Once I became aware of this coming change, I could start coding around it. Thus I avoid one problem in upgrading.

Another good place to keep up on this stuff is the Drupal issues queue.

Plan, plan, plan.

PHP debugging

If you want PHPRecursive acronym for "PHP: Hypertext Preprocessor" - is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. debugging then Xdebug is worth a look http://xdebug.org/docs/remote. Just download the relevant version for your version of PHPRecursive acronym for "PHP: Hypertext Preprocessor" - is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.. EclipseAn Open Source application that provides the framework for an IDE. has an Xdebug plugin built-in; Notepad++ has one availabe also, see the linkThe technique which points to another page, anywhere on the Internet, from the current page. on that page.

Eclipse tutorial information

You can find information on using EclipseAn Open Source application that provides the framework for an IDE. with Drupal

Drupal

An open-source content management system that is used on this site and is taking over the world. at http://drupal.org/node/22296

There is also good information on using EclipseAn Open Source application that provides the framework for an IDE. with Drupal

Drupal

An open-source content management system that is used on this site and is taking over the world. at the IBM tutorial on "Using open source software to design, develop, and deploy a collaborative Web siteA logically grouped set of content - also web site." at http://www.ibm.com/developerworks/ibm/osource/implement.html

Part 3 talks about installing EclipseAn Open Source application that provides the framework for an IDE. and the while LAMP stack on Windows (although I found it easier to use XAMPP) and Part 13 has lots of detail on using CVS.

Have you seen

http://drupal.org/node/179864?

Out of the free ones, my personal preference is JEdit - portable in both senses (cross-platform, runs with zero-config from a flash drive etc)

I keep meaning to set up EclipseAn Open Source application that provides the framework for an IDE., but don't (yet) do enough coding. . .

Thanks

I hadn't seen that. I'm now using Notepad++ pretty much exclusively. I like some of its features and it does just abut everything I need.

An IDEInteractive

An IDEInteractive Deveopment Environment - a collection of tools or applications that allow a developer to produce, test, and document code. that you might try is Notepadd ++.

It has built in support for all kinds of languages including phpRecursive acronym for "PHP: Hypertext Preprocessor" - is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. and htmlHyperText Markup Language - the coding standard for a web page..

Thanks, I'll look for it

Thanks, I'll do a web search for it.