Skip to main content

Blogs

Drupal Development with Drush and Quickstart

    So say you're new to Drupal and have been playing around a bit. You've been exploring the modules and themes available and you're excited about all the possible ideas you might implement. You're deep into the experimentation phase here and time is of the essence! Decompressing the Drupal package for a new site, setting up a sandbox like with LAMP (or MAMP, or XAMPP), and finally configuring the database running the install script takes several minutes and is highly repetitive. Even after setting up a core install there are many common modules like Views, Ctools, or Panels that you need to download, unpack, and enable. How daunting! Is there any way to script things like this so you can get down to work?

Quickstart/Drush to the rescue

    Quickstart is a VirtualBox image of a Ubuntu install with everything you need to start exploring Drupal. After downloading the 1Gb Appliance image, install it into VirtualBox and start it up.  This virtual machine comes with Apache/MySQL/PHP ready to go along with Firefox Add-ons and the Eclipse IDE among other development tools. However, one of the greatest tools for Drupal development is Drush. Drush is: "A command line shell and scripting interface for Drupal" and, with a few extra scripts included with Quickstart, will allow you to setup a new virtual host, create a database, and setup Drupal with one command.

After that, installing modules is just as easy, with one command to download (or clone), and one to enable. 

Now you're free to make Drupal installs at will without all the tedium! Experiment till your heart is content!! Of course it doesn't stop there, Drush can help you script database backups, run updates, manage users, or watch for errors.

I personally find this a more fluid motion for development control much like writing software. The ability to build, backup and burn down projects I'm working on without fear of losing any previous work or getting bogged down in the grunt work lets the creative come first. Go fourth and explore!

Other links

Quickstart YouTube Channel
Drupal.org Drush Documentation
 

Media solutions for Drupal

One of my first projects at Arts & Sciences Computing Services was to work on the Video project. This project was, most basically, a YouTube clone that would allow the college to encode, store, and serve up public and private (copyrighted) video content thereby having complete control of its use, availability, etc. The current implementation was in C# in ASP.Net using FFMPEG to do encoding and some other libraries to handle authentication and file management.

Since I this was my first experience with C#, and more so ASP.Net, I didn't get to make a large impact (or even a tiny dent) on the Video project before a separate project took precedence and I started working with Drupal (Hint: you’re currently looking at said project). It wasn’t long I was wrapped up in writing modules and tweaking Drupal to do our bidding. The Video project was almost out of mind, in fact, until I started researching Drupal's Media module for use on yet another project.

Media module

First a little history: the solution for supporting media in Drupal 5 and 6 had been the Embedded Media Field (emfield) module, along with a hand full of extension modules providing support for 3rd party media providers like YouTube and Flickr. This, of course, wasn’t the only way to skin the cat and there were many more modules with overlapping goals and implementations. Beginning with the development of Drupal 7, the Media module project was created as certain features were added to Drupal Core and the roadmap for a media framework in Drupal changed. Currently, the Media module is in its fourth beta and is racing to a final release. (For an overview from the maintainers at DrupalCon Chicago in early March '10 see this presentation)

The Media module adds a field type "Multimedia asset" that can be used for audio, image, video or other. These types can then be configured with the Style module (a dependency for Media) to display the media assets in different sizes and encapsulations depending on context. For example, video could be delivered via Flash, or HTML 5 depending on browser user agent or show different image sizes when displaying nodes in different contexts. Each type of media asset can also have its own additional fields such as description, copyright.

However, the goals of Media module are not to be an all-in-one bloated heap, rendering all file types and resources. Instead, it is simply providing a framework to store and describe media resources to other Drupal modules. Already, there are modules supporting YouTube, Flickr, and a Media Gallery to show images in groups (check out Drupal Gardens for demos). Support for actual video files are still in between, since browser support for HTML5, Silverlight and Flash is volatile. Player modules such as MediaElement, VidoJS and Flowplayer currently work with other implementations for media such as the Video, and AudioField modules, but sometimes have difficulty when coupled with the Media module.

Arts & Sciences

Media and Drupal are exciting for the projects we’re working on at Arts & Sciences because almost all of them involve large catalogs of audio and video.  For example, one of the research projects I’ve been working on is a library of religious folklore captured in audio, video, and imagery along with translations, commentary and footnotes. The research is impressive and storing, displaying, cross referencing, and making it navigable and useable is an excellent challenge for Drupal and its newest features.

After delving into Drupal and different media solutions, I began to think back to the Video project: uploading large files, encoding, managing collections. Perhaps Drupal could be used to do all of this: using SWFUpload or FTP to handle large uploads, a FFMPEG wrapper module to encode videos, Media to store and manage the elements and Style to display the content in different contexts. This led me to a few Google Summer of Code project for Drupal: "Derivates API for Media ecosystem (D7)" and "Extend functionalities of and add new features to Media module". With the blessing and mentorship of the Media module maintainers, these projects could add features to Media enabling it to store and display Media assets more fluently and across many devices.