--- /dev/null
+#!/bin/bash
+
+# record working dir
+OWD=$(pwd)
+
+# chdir to docroot
+cd $(dirname $0)/../public
+
+function addrefpath {
+ path="$1"
+ if test ${path:0:1} != "/"
+ then
+ REFPATH="$OWD/$path$REFPATH"
+ else
+ REFPATH="$path$REFPATH"
+ fi
+}
+
+# override REFPATH
+if test $# -gt 0; then
+ REFPATH=""
+ addrefpath "$1"
+ shift
+ while test $# -gt 0; do
+ addrefpath "$1:"
+ shift
+ done
+fi
+
+if test -z "$REFPATH"
+then
+ printf "Usage:\n\t%s [refpath] ...\n\n" "$(basename $0)"
+ printf "Parameters:\n"
+ printf "\trefpath path to a markdown reference tree or a colon separated\n"
+ printf "\t list of those (optional, multiple)\n\n"
+ printf "Environment:\n"
+ printf "\tREFPATH colon separated list of refpaths\n\n"
+ printf "At least one refpath must be given, either through the environment "
+ printf "with REFPATH or as command line argument.\n\n"
+ exit 1
+fi
+
+export REFPATH
+
+for p in {8000..8100}; do
+ php -S localhost:$p -t . index.php && break
+done