PHPXref for WordPress, BuddyPress, bbPress and Thematic: Local and Updated

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.

#!/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

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.

3 thoughts on “PHPXref for WordPress, BuddyPress, bbPress and Thematic: Local and Updated

    1. Aaron Jorbin Post author

      I thought about it, but for something this simple I figured it was best to maintain as high readability as possible, and for me that’s best achieved by not doing arrays. Essentially I chose KISS over DRY this time.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *