summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2013-08-20 02:55:04 +0000
committerXuefer <xuefer@gmail.com>2013-08-20 02:55:04 +0000
commit68de62de576d60f31266e247c7b9f308a0e68dd6 (patch)
tree091395e0e02a13de0f1b57cea7e5bcb363ad0b2e
parenta0217c26540d56ca39a7654f8066f6df1c6d293e (diff)
downloadxcache-68de62de576d60f31266e247c7b9f308a0e68dd6.tar.gz
xcache-68de62de576d60f31266e247c7b9f308a0e68dd6.zip
decompiler: more sample templating trick
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1344 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
-rwxr-xr-xdevel/run4
-rw-r--r--mod_disassembler/sample.cpp.php4
2 files changed, 5 insertions, 3 deletions
diff --git a/devel/run b/devel/run
index 1e3fbd7..5765442 100755
--- a/devel/run
+++ b/devel/run
@@ -244,7 +244,9 @@ run() {
shift
case "$1" in
*.cpp.php)
- cpp -C -P -traditional-cpp -DPHP_VERSION=$phpVersion $1 \
+ < "$1" \
+ sed -r -e 's#__#____#g' \
+ | cpp -C -P -traditional-cpp -DPHP_VERSION=$phpVersion \
| 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
diff --git a/mod_disassembler/sample.cpp.php b/mod_disassembler/sample.cpp.php
index 749f264..f635d67 100644
--- a/mod_disassembler/sample.cpp.php
+++ b/mod_disassembler/sample.cpp.php
@@ -531,8 +531,8 @@ require 'require.php';
require_once 'require_once.php';
include 'include.php';
include_once 'include_once.php';
-echo ____FILE____;
-echo ____LINE____;
+echo __FILE__;
+echo __LINE__;
#if PHP_VERSION >= 530
echo 'PHP 5.3+ code testing';
const CONST_VALUE = 1;