Compiling PHP5 with IMAP support on OS X Leopard

Tagged:  

This really shouldn't have been that hard, but it took quite a bit of searching and playing around to finally get this to work.

I started at PHP's IMAP web page which informed me that the first thing I needed to do was grab the c-client libraries and compile it. You can find these here: ftp://ftp.cac.washington.edu/imap/.


cd /SourceCache
curl -O ftp://ftp.cac.washington.edu/imap/c-client.tar.Z
tar -xzvf c-client.tar.Z
cd imap-2007a
sudo make oxp
sudo mkdir /usr/local/imap-2007h/lib
sudo mkdir /usr/local/imap-2007h/include
cp imap-2007a/*.h /usr/local/imap-2007a/include
cp imap-2007a/*.c /usr/local/imap-2007a/lib
cp c-client.a /usr/local/imap-2007a/lib/libc-client.a

When Apple built Leopard they forgot to include the MySQL header files, but were kind enough to offer them up for download at http://www.opensource.apple.com/darwinsource/other/. Download the MySQL binaries, untar and follow the instructions in the README. Its very simple.

Finally...

Is it Christmas?

Can't stop laughing at this...

Tagged:  

Yes, I admit, I subscribe to icanhascheezburger.com via RSS and spend five or ten minutes a day laughing at the hilarity (IMO) that these guys come up with. But there was one post last week that I'm continually going back to that makes me laugh hysterically. So, I thought I'd share...

Horse in Car - icanhascheezburger.com

Poor kid. He'll probably never get on a horse/mule again.

Capistrano Meets Drupal

There are some very trivial administration tasks that I find myself doing over and over again in Drupal which can't currently be done from the admin interface. As of right now, these include installing a theme or module from drupal.org or adding a new site to an existing Drupal install. So, I've built a tiny Capistrano file that allows me to automate these tasks.

The tasks that I've setup are:

cap drupal:install:theme
cap drupal:install:module
cap drupal:install:site

cap drupal:install:theme

All this task requires is a path to the tar file of the theme that you want to install. What I do is browse over to the list of Drupal themes, find one that I want to try out, and copy the location of the "Download" link for the correct theme. In Firefox and Safari its as simple as right clicking the link and selecting "Copy Link Location". Make sure the version of the theme corresponds to the version of Drupal you have installed.

Once you've got the location to your theme copied, run the task with cap drupal:install:theme. It will ask you for the path to the theme location which you can then paste in. That's it. You should be able to browse to admin/build/themes and see your newly installed theme.

Rails' observe_field with :on - Rails 2.0

In a previous post I showed how to get around a bug in Prototype that was ignoring the "on" parameter of the observe_field function. The solution I originally posted no longer works with the latest version of Rails and Prototype. Although the documentation for observe_field received a facelift, somehow the Rails team still missed the fact that the :on function doesn't work with the current version of Prototype. Or maybe its the Prototype guys we should be after here. :-)

The new fix requires a change to both prototype.js and a small Rails core update.

I will start with the update to prototype.js. Search for Abstract.EventObserver (around line 3632 in my version). That should now read

Abstract.EventObserver = Class.create({
  initialize: function(element, callback, trigger) {
    this.element  = $(element);
    this.callback = callback;
    this.trigger = trigger;

    this.lastValue = this.getValue();
    if (this.element.tagName.toLowerCase() == 'form')
      this.registerFormCallbacks();
    else
      this.registerCallback(this.element, this.trigger);
  },

  onElementEvent: function() {
    var value = this.getValue();
    if (this.lastValue != value) {
      this.callback(this.element, value);
      this.lastValue = value;
    }
  },

  registerFormCallbacks: function() {
    

Want an iPhone for Christmas?

Tagged:  

Integrum held their annual Christmas party this past Saturday. We all had a great time and were shocked at the end of the night by a surprise iPhone gift from Jade.

Being that I already have an iPhone, I've decided to raffle mine off and use the money from the raffle to buy clothing and supplies for HomeBase Youth Services, a non-profit agency that helps homeless and at-risk youth (under 21) in Arizona.

So, on with the sales pitch... Please join me in supporting HomeBase by visiting appleiphoneraffle.com to get details on how you can purchase your tickets to win this great phone. Its an 8GB and its still in the shrink wrap - so don't waste any time people.

The drawing will be held on Tuesday, December 18th and results will be posted on the raffle website.

Its Going to Snow ... in Phoenix!

Tagged:  

At least according to my weather widget...

snowing in phoenix

Drupal and Ruby on Rails

Because I'm a fan of both Ruby on Rails and Drupal (yes, Drupal uses PHP), I get a surprising number of visits to my website each day from Google searches that include some combination of the two as keywords. I find this strange because if you know either of the two, you know that they're in two totally separate worlds.

Drupal doesn't expose any kind of API (besides RSS feeds) that Rails could take advantage of, nor does it make sense to create one.

Since Drupal uses PHP, you can't create module for it in Rails. The only way I could possibly think to marry the two would be to create a module that simply puts an iframe on the page and loads it with your Rails app. In fact, it doesn't even have to be a module. It could be a simple page you create with an iframe pointing to your Rails app.

But why in the hell would anyone want to do this? I guess I'm a little short sighted on this issue right now as its hard to see where the two would play nicely with each other, or why you would want them to. If you want to extend Drupal, use PHP. If you want to use Rails, look at Mephisto or Radiant CMS and extend either of those.

Drupal with Lighttpd and XCache on Debian

After several years of tinkering with my Drupal deployment stack, I've finally found one that I think is both stable and performant. There is usually a trade-off between the two, but not anymore.

Debian Setup

My stack starts with the latest version of Debian Etch. Both Slicehost and RimuHosting provide these as an OS choice for their VPS plans.

Now, some people will only use packages from the stable repositories on Debian. If you're one of those people, you can still follow the majority of this tutorial. However, you will need to skip the part about updating sources.list and you also won't be able to install the php5-xcache package using apt (as of this post its still only available in test). You will still be able to download and build XCache from source, but I won't be going over that here.

From my own experience, I've found that the packages in test are "stable enough". Of the small bugs that do get into test, I haven't ran into them, nor (as of this post) are there any bugs in test that effect the packages we'll be installing here.

So, first thing we'll do is edit our sources.list file to include the testing repository if you haven't already done so.

nano /etc/apt/sources.list

Google Base Integration with Ubercart

There have been several requests on the Ubercart forums for a Google Base feed of the products in a store. I first attempted to do this using Views and the Views RSS modules, but due to some of the custom required fields it wasn't doable.

However, it was very simple to wrap up into a small contrib module for Ubercart which I've uploaded here.

The module allows you to customize the feed title, link, and description via its settings form. It includes all taxonomy terms for a product in the product_type field and uses the first product image for the image link.

Please direct all comments, suggestions, and critiques to the contrib page.

Ubercart is a highly customizable e-commerce package for Drupal with a very bright future.

Syndicate content