summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2013-07-19 05:03:07 +0000
committerXuefer <xuefer@gmail.com>2013-07-19 05:03:07 +0000
commite8600f7d4a339b17a3f7544aa8066e6533af1a91 (patch)
tree32b2804dfc0e02eba9c338b62ea5847ca2bd8f6a /devel
parentf77dead6de8af75cba00610c5de133c556761da7 (diff)
downloadxcache-e8600f7d4a339b17a3f7544aa8066e6533af1a91.tar.gz
xcache-e8600f7d4a339b17a3f7544aa8066e6533af1a91.zip
devel: use cpp to generate samples for different php version
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1334 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'devel')
-rwxr-xr-xdevel/run20
1 files changed, 19 insertions, 1 deletions
diff --git a/devel/run b/devel/run
index 81d3915..1e56817 100755
--- a/devel/run
+++ b/devel/run
@@ -241,7 +241,17 @@ run() {
case "$1" in
dc)
shift
- ./php-cli -c devel.ini ./bin/phpdc.phpr $@ | tee decompiled.php
+ case "$1" in
+ *.cpp.php)
+ cpp -C -P -traditional-cpp -DPHP_VERSION=$phpVersion $1 \
+ | sed -r -e 's#^ +##g' -e 's#\t +#\t#g' -e 's#____#__#g' > sample.php || exit $?
+ shift
+ ./php-cli -c devel.ini ./bin/phpdc.phpr sample.php "$@" | tee decompiled.php
+ ;;
+ *)
+ ./php-cli -c devel.ini ./bin/phpdc.phpr "$@" | tee decompiled.php
+ ;;
+ esac
return
;;
retest)
@@ -347,6 +357,14 @@ run() {
}
for phpbasename in "${dirs[@]}"; do
+ phpVersion=${phpbasename%%-*}
+ phpVersion=${phpVersion##php}
+ phpVersion=${phpVersion/./}
+ case "$phpVersion" in
+ ??) phpVersion="${phpVersion}0";;
+ ?) phpVersion="${phpVersion}00";;
+ esac
+
# devel actions
case "$1" in
prep*) shift; prep "$@"; exit;;