Go to the Stanford University web site
or
Log In
(To add something to the Commons.)

Tutorial

Prime Your Cache with a Cron Job

Properly configuring caching on a Drupal site is one of the most important things that a site administrator can do to improve performance. Caching represents a tradeoff between speed and "freshness" of content, however. There are some tools, such as the Boost crawler, that can prime your cache.

(See also: Load Page Cache after Cron Runs.)

Using Drush to Download from Stanford's Features Server

If you want to use drush to download from Stanford's Drupal Features server, use the following syntax:

drush dl projectname --source=http://drupalfeatures.stanford.edu/fserver/projectname/core.version

E.g., to download webauth for Drupal 7, use:

Drupal 8 Installation Instructions

This quick note outlines the additional steps required for installing Drupal 8 on the central web infrastructure (www.stanford.edu and AFS). In other words, it doesn't show all the steps (download Drupal, untar it, etc.), just the few steps needed that are special to our infrastructure.

Drupal 6 to Drupal 7 Migration Worksheet

This document is a work in progress. For a formatted version of this worksheet that you can print and fill out, download the PDF.

Rationale for This Document

An upgrade of a Drupal 6 website is a complex proposition. As a general rule of thumb, many professional Drupal development teams approach a major Drupal version upgrade as a new site development project, and estimate anywhere from 60-80% of the original development resources (time, money) for the upgrade.

drush sqlq formatting

How To

Ever get frustrated about the output from 'drush sqlq'?

Add '--extra="-t"' to your 'drush sqlq' command, and get a nicely-formatted table. ("--extra" allows you to include any options you would pass to 'mysql').

(Run 'man mysql' to see more options to pass to '--extra'.)

Direct PHP errors to a log file of your choosing

Thanks to John Bickar for the code below.

Developers working with sites on www.stanford.edu don’t get direct access to Apache’s error log. To troubleshoot your PHP applications, you can create a local php.ini file with the lines below. This will redirect PHP errors to a file of your choosing. Make sure to remove these lines and the file containing the errors once you are done troubleshooting to avoid disclosing the internal workings of your application.

Drupal 6 Installation Instructions

There are two ways you can run Drupal 6.x at Stanford.

Stanford Sites

Request your Drupal 6.x site on the Stanford Sites service. This is open to everyone, including individuals. Installation is easy and code updates and maintenance are handled by IT Services. You can't install your own modules or themes, but installations come with plenty of pre-installed modules chosen by the community. Read more at sites.stanford.edu.

Show git branch in bash prompt

It's considered good practice to create feature branches in git when working on new functionality. The problem with this is that knowing which branch you are in is not obvious. Pasting the following into your .bashrc file will display the current branch in your prompt.

Mounting an AFS .backup Directory

AFS gets backed up nightly, and most AFS spaces (group, dept, and user) have a hidden directory, named .backup, that provides instantaneous access to the previous night's backup.

Here's what to do if that .backup directory does not appear.

SSH into one of the timeshares (e.g., corn), cd to the root directory of the dept/group/user, and run the following command:

fs mkmount -dir .backup -vol <name-of-volume>.backup

Simple Git Fast Forward

If you get the befuddling message:

Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded

you can just run:

git pull

Or, if that doesn't work:

git pull origin master

(I think.)

The above might seem obvious to some, but Googling "git fast forward" proved surprisingly unfruitful. HTH.