Drush on Windows and Mac

Yes, this is another post about Drupal. I just feel like I need to write some of this stuff down as I figure it out, for my own reference if nothing else. I recently got Drush working on both my work PC and my Mac.

Surprisingly, it was a lot easier to get working under Windows than under Mac OS X. The Windows setup is mostly accomplished by just running this installer. The main MSI file up on the site right now is dated 6/4/12, so it’s up to date. The only thing I changed was to edit the path settings post-install to put my existing copy of PHP in my path, so Drush could find it.

On the Mac, I wanted to follow the recommendation on the main Drush page to do the install via Pear. I did not have Pear set up on my Mac, though, so I needed to figure that out first. That’s not hard to do under 10.7, as described in this blog post. I then had a couple of permission problems to work through, but after taking care of those, I seem to have a working Drush install.

I also needed to do a little follow-up work to add /usr/local/mysql/bin to my path, to get archive-dump to work. I’m not sure why I hadn’t added that to my path when I installed MySQL back in December. (I was amused, by the way, to see that the last edit to my .bash_profile was from back in 2005. Apparently, I was trying to get gpg working. Also, apparently, .bash_profile gets pulled along when you migrate to a new Mac, since my current MacBook isn’t quite that old.)

I intend to write a post soon on how I’m running a PHP script under Drush to import data into Drupal, but i don’t think I’m going to write that up today.

Drupal 7 Development

I’m continuing my somewhat slow attempt to become a Drupal expert. After finishing up a couple of general Drupal books from Packt, I started “Drupal 7 Module Development,” also from Packt. I got up to chapter four, then put it down in frustration. I’ll likely pick it up again, but it’s not an easy book to read straight through, with little prior Drupal dev experience.

So, then I picked up “Pro Drupal 7 for Windows Developers,” and I’m doing much better with that one. I just finished chapter 5, which walks you through the creation of a simple, but non-trivial, module. I found it fairly easy to follow, and a good start. The book is (obviously) written for Windows programmers looking to learn Drupal, specifically ASP.NET developers, so it’s a good fit for me.

There’s still a lot more to learn. Drupal’s API and hook system are fairly complex and extensive. But I think I’m on the right path.

PHP IDEs

Since I’m doing more and more PHP development, I’ve been spending a bit of time trying to figure out if I can put together a decent development and debugging environment. Up until now, I’ve just been using Notepad++ (on the PC) and TextMate (on the Mac).

I’ve switched over to Komodo Edit on both platforms now, and that works pretty well. To do debugging, you need to spend $300 on Komodo IDE. But Komodo Edit does a lot, including auto-completion, syntax checking, and the ability to drill down into function definitions.

I like the idea of having a debugger, of course, so I decided to explore a couple of free IDEs that would support that. Netbeans looks nice, but it’s pretty heavy. Eclipse PDT is a bit better, but still kind of bloated. I think I may have to spend the $300 on Komodo IDE.