drush

Drush and cloning

I need to pull down a site I have on my other computer but haven't setup here for local development. I keep thinking there should be a 'drush clone' command... well there is but it clones modules not the way I'm thinking of. Basically the command I have in mind would:

  1. Clone the git repository of the site into the proper local directory.
  2. Copy the files from the production or developer site.
  3. Create the local database and sync from production or developer instance.
  4. Or instead of syncing the database do a site install if that's called for.

This requires of course that drush aliases already exist for the site. How to handle this and keep everybody in sync. Well, here's my stab at a highly configurable, very customizable drush configuration for people who work with one or more teams.

More Alfred and drush love

A couple years ago I started playing with using the stellar Alfred.app with drush to get things done. This post describes how I used a now defunct URL shortener to create short links from Alfred.

Fast forward a couple of years and Adjix is no longer but the basic script still works. However it had run into a couple of issues like being hard-coded to drush paths which can vary from machine to machine. This was because the non-interactive shell wasn't picking up all the wonderful things like my $PATH definitions in settings files. So a bit of work later and this script now looks like this:

#!/bin/bash
source ~/.bashrc
echo `drush @site.env ev 'print (shorten_url("{query}"));'`

That's it. Well there are two outputs of the workflow. The first copies the results of the statement to the clipboard. The other posts it to Notification Center so you know the work is done and get to see the URL for your shortened link.

Drush make and Pressflow

A quick note on using Pressflow as the basis of a Drush build using Drush make can be a little confusing as the changes necessary to use the newer github-based repository aren't abundant. So without further ado here's what works:


projects[pressflow][type] = "core"
projects[pressflow][download][type] = "git"
projects[pressflow][download][url] = "https://github.com/pressflow/6.git"
projects[pressflow][download][tag] = "DRUPAL-6-24"

Note that the previous instructions around the web tend to be problematic because the tarball file contains a git repo which Drush make doesn't know to strop since it's getting it as a tarball instead of from git.

Create custom Adjix short URLs with Alfred

Alfred.app Logo Although I use it all the time it turns I haven't written here about Adjix. There is one mention in some issues but nothing that spells out just how awesome it is. The short version is Adjix is hands down the single best URL shortener out there. While it deserves it's own post suffice it to say you can use its power and still retain a copy of your links on your own S3 drive. Future proofing at its best.

But this post isn't about that. It's about using your own custom domain and setting up a URL shortener that works from Alfred. Alfred is itself another awesome tool that deserves yet another post. Inspired by a post on Dirt Don I set out to create a url shortening shortcut. (Recursion is encouraged).

So based on this post I setup a quick shell script shortcut in Alfred. The properties end up looking something like this:

Drush away unserialize() errors

When you work with the great folks I do every day it comes as little surprise that when the stuff hits the fan and some site is in need of help there will be a legion of folks who jump into round-the-clock action to get things in a better place. While this could be a whole blog post about that alone it's not about that. Rather it's about one of those nagging little problems we came across while working on a site this Thanksgiving "holiday".

The problem is one that many have seen at one point or another:

[26-Nov-2011 22:35:17] PHP Notice:  unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 200 of 1100 bytes in /var/www/mysite/includes/bootstrap.inc on line 1104

In fact this problem pops up enough that it has its own page in the Drupal Handbook. The problem is pretty straightforward to understand. Some object was serialized for storage in the database and has become corrupted.

Subscribe to drush