I often am working on a variety of WordPress, BuddyPress, and BBPress projects and enjoy working from a lot of not internet connected locations such as trains, buses, parks and the occasional rooftop. As such it’s very handy for me to a local version of PHPXref documents for the current trunk of these products. I’ve written a handy bash script to handle this for me.

[bash]
#!/bin/bash

# define locations
PHPXREFLOCATION=’/full/path/to/phpxref/folder/with/no/trailing/slash’

# check our internet connection
wget -q –tries=10 –timeout=5 http://core.svn.wordpress.org/trunk/ -O /tmp/wordpress.svn &> /dev/null
if [ ! -s /tmp/wordpress.svn ];then

# Remove old version
rm -r $PHPXREFLOCATION/output/*

# SVN up each piece
cd $PHPXREFLOCATION/source/thematic
svn up
cd $PHPXREFLOCATION/source/wordpress
svn up
cd $PHPXREFLOCATION/source/bbpress
svn up
cd $PHPXREFLOCATION/source/buddypress
svn up
cd $PHPXREFLOCATION/

# Build our new phpxref
perl phpxref.pl

#remove the tmp file so it’s not there for next time
rm /tmp/wordpress.svn

fi
[/bash]

I have a cron set up to run this at a few intervals that are least likely to bother me (currently 5am and 4pm). I hope this script helps you out. If you have a similar or better one, please let me know.