--3305:xp:-- #!/bin/sh if [ "$OS" = "Windows_NT" ]; then PATHSEP=';' DIRSEP='\' else PATHSEP=':' DIRSEP='/' fi if [ -L "$0" ] ; then link="$(readlink "$0")" case "$link" in /*) DIRNAME=$(dirname "$link") ;; # Absolute *) DIRNAME=$(dirname "$(dirname "$0")/$link") ;; # Relative esac else DIRNAME=$(dirname "$0") fi translate_path() { base="$1" path="$2" case "$path" in ?:*) ;; # C:\xp \\*) ;; # \\filesrv\shares /*) ;; # /usr/local/lib */ ~*) path=$HOME$DIRSEP${path#"~"} ;; # ~/lib *) path=$base$DIRSEP$path ;; # lib, ../lib, ./classes esac if [ "$OS" = "Windows_NT" ]; then echo $(cygpath -m "$path") else echo $path fi } translate_paths() { base="$1" path="$2" translated="" IFS="$PATHSEP" for i in $path ; do translated="$translated$PATHSEP"$(translate_path "$base" "$i") done echo "${translated#$PATHSEP}" } locate() { path="$1" file="$2" expect=$3 IFS="$PATHSEP" for i in $path ; do qualified="$i/$file" if [ -e "$qualified" ] ; then echo "$qualified" if [ $expect = 1 ] ; then return ; fi fi done if [ $expect = 1 ] ; then echo "*** Failed to locate $file in $path" >&2 ; fi echo "" } OPTIND=0 INCLUDE_PATH="." TOOL= RUNNER="class" for arg in "$@" ; do if [ ! -z "$INCLUDE_ARG" ] ; then INCLUDE_PATH="$arg$INCLUDE_ARG$INCLUDE_PATH" ; INCLUDE_ARG="" OPTIND=`expr $OPTIND + 2` continue fi case $arg in -v) # Display version TOOL="xp.runtime.Version" OPTIND=$(expr $OPTIND + 1) ;; -e) # Run source passed via command line TOOL="xp.runtime.Evaluate" OPTIND=$(expr $OPTIND + 1) ;; -cp) # Add class path INCLUDE_ARG=${PATHSEP} ;; -xar) # Run a xar RUNNER="xar" OPTIND=$(expr $OPTIND + 1) ;; -*) # Any other arg echo "*** Invalid argument $arg" echo ${USAGE} exit ;; *) # First arg we find that does not begin with a "-" break ;; esac done shift $OPTIND base="$DIRNAME" RUNNER=$RUNNER INCLUDE=$INCLUDE_PATH xppath="$DIRNAME" ARGS=$TOOL IFS="|"; XP_RT=${XP_RT-php} ifs="|" if [ "" = "$USE_XP" ] ; then section=default while read line ; do case "$line" in use=*) USE_XP=$(translate_paths "$base" "${line#*=}") ;; \[*\]) section=${line#[} section=${section%]} ;; *=*) if [ runtime = $section ] ; then key=${line%=*} XP_RT="${line#*=}" else echo "*** Unknown configuration $line in section $section" >&2 fi esac done < "$base"/xp.ini else USE_XP=$(translate_paths "." "$USE_XP") fi args="-dinclude_path=\".$PATHSEP$USE_XP$PATHSEP$PATHSEP$INCLUDE\"${ifs}-dmagic_quotes_gpc=0" IFS=" " for ini in $(locate "$USE_XP" "php.ini" 0) ; do while read line ; do case "$line" in *=*) key=${line%=*} if [ "executor" = "$key" ]; then XP_RT="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done export XP_RT IFS="|" ${XP_RT}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${RUNNER}".php" 1) ${ARGS} "$@" --2492:xar:-- #!/bin/sh if [ "$OS" = "Windows_NT" ]; then PATHSEP=';' DIRSEP='\' else PATHSEP=':' DIRSEP='/' fi if [ -L "$0" ] ; then link="$(readlink "$0")" case "$link" in /*) DIRNAME=$(dirname "$link") ;; # Absolute *) DIRNAME=$(dirname "$(dirname "$0")/$link") ;; # Relative esac else DIRNAME=$(dirname "$0") fi translate_path() { base="$1" path="$2" case "$path" in ?:*) ;; # C:\xp \\*) ;; # \\filesrv\shares /*) ;; # /usr/local/lib */ ~*) path=$HOME$DIRSEP${path#"~"} ;; # ~/lib *) path=$base$DIRSEP$path ;; # lib, ../lib, ./classes esac if [ "$OS" = "Windows_NT" ]; then echo $(cygpath -m "$path") else echo $path fi } translate_paths() { base="$1" path="$2" translated="" IFS="$PATHSEP" for i in $path ; do translated="$translated$PATHSEP"$(translate_path "$base" "$i") done echo "${translated#$PATHSEP}" } locate() { path="$1" file="$2" expect=$3 IFS="$PATHSEP" for i in $path ; do qualified="$i/$file" if [ -e "$qualified" ] ; then echo "$qualified" if [ $expect = 1 ] ; then return ; fi fi done if [ $expect = 1 ] ; then echo "*** Failed to locate $file in $path" >&2 ; fi echo "" } base="$DIRNAME" RUNNER="class" INCLUDE="." xppath="$DIRNAME" ARGS=xp.xar.Runner IFS="|"; XP_RT=${XP_RT-php} ifs="|" if [ "" = "$USE_XP" ] ; then section=default while read line ; do case "$line" in use=*) USE_XP=$(translate_paths "$base" "${line#*=}") ;; \[*\]) section=${line#[} section=${section%]} ;; *=*) if [ runtime = $section ] ; then key=${line%=*} XP_RT="${line#*=}" else echo "*** Unknown configuration $line in section $section" >&2 fi esac done < "$base"/xp.ini else USE_XP=$(translate_paths "." "$USE_XP") fi args="-dinclude_path=\".$PATHSEP$USE_XP$PATHSEP$PATHSEP$INCLUDE\"${ifs}-dmagic_quotes_gpc=0" IFS=" " for ini in $(locate "$USE_XP" "php.ini" 0) ; do while read line ; do case "$line" in *=*) key=${line%=*} if [ "executor" = "$key" ]; then XP_RT="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done export XP_RT IFS="|" ${XP_RT}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${RUNNER}".php" 1) ${ARGS} "$@" --2496:xpcli:-- #!/bin/sh if [ "$OS" = "Windows_NT" ]; then PATHSEP=';' DIRSEP='\' else PATHSEP=':' DIRSEP='/' fi if [ -L "$0" ] ; then link="$(readlink "$0")" case "$link" in /*) DIRNAME=$(dirname "$link") ;; # Absolute *) DIRNAME=$(dirname "$(dirname "$0")/$link") ;; # Relative esac else DIRNAME=$(dirname "$0") fi translate_path() { base="$1" path="$2" case "$path" in ?:*) ;; # C:\xp \\*) ;; # \\filesrv\shares /*) ;; # /usr/local/lib */ ~*) path=$HOME$DIRSEP${path#"~"} ;; # ~/lib *) path=$base$DIRSEP$path ;; # lib, ../lib, ./classes esac if [ "$OS" = "Windows_NT" ]; then echo $(cygpath -m "$path") else echo $path fi } translate_paths() { base="$1" path="$2" translated="" IFS="$PATHSEP" for i in $path ; do translated="$translated$PATHSEP"$(translate_path "$base" "$i") done echo "${translated#$PATHSEP}" } locate() { path="$1" file="$2" expect=$3 IFS="$PATHSEP" for i in $path ; do qualified="$i/$file" if [ -e "$qualified" ] ; then echo "$qualified" if [ $expect = 1 ] ; then return ; fi fi done if [ $expect = 1 ] ; then echo "*** Failed to locate $file in $path" >&2 ; fi echo "" } base="$DIRNAME" RUNNER="class" INCLUDE="." xppath="$DIRNAME" ARGS=xp.command.Runner IFS="|"; XP_RT=${XP_RT-php} ifs="|" if [ "" = "$USE_XP" ] ; then section=default while read line ; do case "$line" in use=*) USE_XP=$(translate_paths "$base" "${line#*=}") ;; \[*\]) section=${line#[} section=${section%]} ;; *=*) if [ runtime = $section ] ; then key=${line%=*} XP_RT="${line#*=}" else echo "*** Unknown configuration $line in section $section" >&2 fi esac done < "$base"/xp.ini else USE_XP=$(translate_paths "." "$USE_XP") fi args="-dinclude_path=\".$PATHSEP$USE_XP$PATHSEP$PATHSEP$INCLUDE\"${ifs}-dmagic_quotes_gpc=0" IFS=" " for ini in $(locate "$USE_XP" "php.ini" 0) ; do while read line ; do case "$line" in *=*) key=${line%=*} if [ "executor" = "$key" ]; then XP_RT="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done export XP_RT IFS="|" ${XP_RT}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${RUNNER}".php" 1) ${ARGS} "$@" --2497:unittest:-- #!/bin/sh if [ "$OS" = "Windows_NT" ]; then PATHSEP=';' DIRSEP='\' else PATHSEP=':' DIRSEP='/' fi if [ -L "$0" ] ; then link="$(readlink "$0")" case "$link" in /*) DIRNAME=$(dirname "$link") ;; # Absolute *) DIRNAME=$(dirname "$(dirname "$0")/$link") ;; # Relative esac else DIRNAME=$(dirname "$0") fi translate_path() { base="$1" path="$2" case "$path" in ?:*) ;; # C:\xp \\*) ;; # \\filesrv\shares /*) ;; # /usr/local/lib */ ~*) path=$HOME$DIRSEP${path#"~"} ;; # ~/lib *) path=$base$DIRSEP$path ;; # lib, ../lib, ./classes esac if [ "$OS" = "Windows_NT" ]; then echo $(cygpath -m "$path") else echo $path fi } translate_paths() { base="$1" path="$2" translated="" IFS="$PATHSEP" for i in $path ; do translated="$translated$PATHSEP"$(translate_path "$base" "$i") done echo "${translated#$PATHSEP}" } locate() { path="$1" file="$2" expect=$3 IFS="$PATHSEP" for i in $path ; do qualified="$i/$file" if [ -e "$qualified" ] ; then echo "$qualified" if [ $expect = 1 ] ; then return ; fi fi done if [ $expect = 1 ] ; then echo "*** Failed to locate $file in $path" >&2 ; fi echo "" } base="$DIRNAME" RUNNER="class" INCLUDE="." xppath="$DIRNAME" ARGS=xp.unittest.Runner IFS="|"; XP_RT=${XP_RT-php} ifs="|" if [ "" = "$USE_XP" ] ; then section=default while read line ; do case "$line" in use=*) USE_XP=$(translate_paths "$base" "${line#*=}") ;; \[*\]) section=${line#[} section=${section%]} ;; *=*) if [ runtime = $section ] ; then key=${line%=*} XP_RT="${line#*=}" else echo "*** Unknown configuration $line in section $section" >&2 fi esac done < "$base"/xp.ini else USE_XP=$(translate_paths "." "$USE_XP") fi args="-dinclude_path=\".$PATHSEP$USE_XP$PATHSEP$PATHSEP$INCLUDE\"${ifs}-dmagic_quotes_gpc=0" IFS=" " for ini in $(locate "$USE_XP" "php.ini" 0) ; do while read line ; do case "$line" in *=*) key=${line%=*} if [ "executor" = "$key" ]; then XP_RT="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done export XP_RT IFS="|" ${XP_RT}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${RUNNER}".php" 1) ${ARGS} "$@" --2495:doclet:-- #!/bin/sh if [ "$OS" = "Windows_NT" ]; then PATHSEP=';' DIRSEP='\' else PATHSEP=':' DIRSEP='/' fi if [ -L "$0" ] ; then link="$(readlink "$0")" case "$link" in /*) DIRNAME=$(dirname "$link") ;; # Absolute *) DIRNAME=$(dirname "$(dirname "$0")/$link") ;; # Relative esac else DIRNAME=$(dirname "$0") fi translate_path() { base="$1" path="$2" case "$path" in ?:*) ;; # C:\xp \\*) ;; # \\filesrv\shares /*) ;; # /usr/local/lib */ ~*) path=$HOME$DIRSEP${path#"~"} ;; # ~/lib *) path=$base$DIRSEP$path ;; # lib, ../lib, ./classes esac if [ "$OS" = "Windows_NT" ]; then echo $(cygpath -m "$path") else echo $path fi } translate_paths() { base="$1" path="$2" translated="" IFS="$PATHSEP" for i in $path ; do translated="$translated$PATHSEP"$(translate_path "$base" "$i") done echo "${translated#$PATHSEP}" } locate() { path="$1" file="$2" expect=$3 IFS="$PATHSEP" for i in $path ; do qualified="$i/$file" if [ -e "$qualified" ] ; then echo "$qualified" if [ $expect = 1 ] ; then return ; fi fi done if [ $expect = 1 ] ; then echo "*** Failed to locate $file in $path" >&2 ; fi echo "" } base="$DIRNAME" RUNNER="class" INCLUDE="." xppath="$DIRNAME" ARGS=xp.doclet.Runner IFS="|"; XP_RT=${XP_RT-php} ifs="|" if [ "" = "$USE_XP" ] ; then section=default while read line ; do case "$line" in use=*) USE_XP=$(translate_paths "$base" "${line#*=}") ;; \[*\]) section=${line#[} section=${section%]} ;; *=*) if [ runtime = $section ] ; then key=${line%=*} XP_RT="${line#*=}" else echo "*** Unknown configuration $line in section $section" >&2 fi esac done < "$base"/xp.ini else USE_XP=$(translate_paths "." "$USE_XP") fi args="-dinclude_path=\".$PATHSEP$USE_XP$PATHSEP$PATHSEP$INCLUDE\"${ifs}-dmagic_quotes_gpc=0" IFS=" " for ini in $(locate "$USE_XP" "php.ini" 0) ; do while read line ; do case "$line" in *=*) key=${line%=*} if [ "executor" = "$key" ]; then XP_RT="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done export XP_RT IFS="|" ${XP_RT}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${RUNNER}".php" 1) ${ARGS} "$@" --2496:cgen:-- #!/bin/sh if [ "$OS" = "Windows_NT" ]; then PATHSEP=';' DIRSEP='\' else PATHSEP=':' DIRSEP='/' fi if [ -L "$0" ] ; then link="$(readlink "$0")" case "$link" in /*) DIRNAME=$(dirname "$link") ;; # Absolute *) DIRNAME=$(dirname "$(dirname "$0")/$link") ;; # Relative esac else DIRNAME=$(dirname "$0") fi translate_path() { base="$1" path="$2" case "$path" in ?:*) ;; # C:\xp \\*) ;; # \\filesrv\shares /*) ;; # /usr/local/lib */ ~*) path=$HOME$DIRSEP${path#"~"} ;; # ~/lib *) path=$base$DIRSEP$path ;; # lib, ../lib, ./classes esac if [ "$OS" = "Windows_NT" ]; then echo $(cygpath -m "$path") else echo $path fi } translate_paths() { base="$1" path="$2" translated="" IFS="$PATHSEP" for i in $path ; do translated="$translated$PATHSEP"$(translate_path "$base" "$i") done echo "${translated#$PATHSEP}" } locate() { path="$1" file="$2" expect=$3 IFS="$PATHSEP" for i in $path ; do qualified="$i/$file" if [ -e "$qualified" ] ; then echo "$qualified" if [ $expect = 1 ] ; then return ; fi fi done if [ $expect = 1 ] ; then echo "*** Failed to locate $file in $path" >&2 ; fi echo "" } base="$DIRNAME" RUNNER="class" INCLUDE="." xppath="$DIRNAME" ARGS=xp.codegen.Runner IFS="|"; XP_RT=${XP_RT-php} ifs="|" if [ "" = "$USE_XP" ] ; then section=default while read line ; do case "$line" in use=*) USE_XP=$(translate_paths "$base" "${line#*=}") ;; \[*\]) section=${line#[} section=${section%]} ;; *=*) if [ runtime = $section ] ; then key=${line%=*} XP_RT="${line#*=}" else echo "*** Unknown configuration $line in section $section" >&2 fi esac done < "$base"/xp.ini else USE_XP=$(translate_paths "." "$USE_XP") fi args="-dinclude_path=\".$PATHSEP$USE_XP$PATHSEP$PATHSEP$INCLUDE\"${ifs}-dmagic_quotes_gpc=0" IFS=" " for ini in $(locate "$USE_XP" "php.ini" 0) ; do while read line ; do case "$line" in *=*) key=${line%=*} if [ "executor" = "$key" ]; then XP_RT="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done export XP_RT IFS="|" ${XP_RT}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${RUNNER}".php" 1) ${ARGS} "$@"