--3435: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 "" } execute() { base="$1" runner="$2" include="$3" xppath="$1" ifs="|" executor=${XP_RT-php} 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%=*} executor="${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 executor="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done IFS=" " echo ${executor}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${runner}".php" 1) } 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 cmd=$(execute "$DIRNAME" $RUNNER $INCLUDE_PATH); IFS="|"; $cmd $TOOL "$@"; --2622: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 "" } execute() { base="$1" runner="$2" include="$3" xppath="$1" ifs="|" executor=${XP_RT-php} 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%=*} executor="${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 executor="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done IFS=" " echo ${executor}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${runner}".php" 1) } cmd=$(execute "$DIRNAME" "class" "."); IFS="|"; $cmd xp.xar.Runner "$@"; --2626: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 "" } execute() { base="$1" runner="$2" include="$3" xppath="$1" ifs="|" executor=${XP_RT-php} 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%=*} executor="${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 executor="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done IFS=" " echo ${executor}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${runner}".php" 1) } cmd=$(execute "$DIRNAME" "class" "."); IFS="|"; $cmd xp.command.Runner "$@"; --2627: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 "" } execute() { base="$1" runner="$2" include="$3" xppath="$1" ifs="|" executor=${XP_RT-php} 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%=*} executor="${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 executor="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done IFS=" " echo ${executor}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${runner}".php" 1) } cmd=$(execute "$DIRNAME" "class" "."); IFS="|"; $cmd xp.unittest.Runner "$@"; --2625: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 "" } execute() { base="$1" runner="$2" include="$3" xppath="$1" ifs="|" executor=${XP_RT-php} 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%=*} executor="${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 executor="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done IFS=" " echo ${executor}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${runner}".php" 1) } cmd=$(execute "$DIRNAME" "class" "."); IFS="|"; $cmd xp.doclet.Runner "$@"; --2626: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 "" } execute() { base="$1" runner="$2" include="$3" xppath="$1" ifs="|" executor=${XP_RT-php} 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%=*} executor="${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 executor="${line#*=}" else args="$args${ifs}-d$key=\"${line#*=}\"" fi ;; esac done < $ini done IFS=" " echo ${executor}${ifs}${args}${ifs}$(locate "$USE_XP" "tools/"${runner}".php" 1) } cmd=$(execute "$DIRNAME" "class" "."); IFS="|"; $cmd xp.codegen.Runner "$@";