Changeset 1334 in svn for trunk/devel/run


Ignore:
Timestamp:
2013-07-19T07:03:07+02:00 (2 years ago)
Author:
Xuefer
Message:

devel: use cpp to generate samples for different php version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/devel/run

    r1324 r1334  
    242242    dc)
    243243        shift
    244         ./php-cli -c devel.ini ./bin/phpdc.phpr $@ | tee decompiled.php
     244        case "$1" in
     245        *.cpp.php)
     246            cpp -C -P -traditional-cpp -DPHP_VERSION=$phpVersion $1 \
     247            | sed -r -e 's#^ +##g' -e 's#\t +#\t#g' -e 's#____#__#g' > sample.php || exit $?
     248            shift
     249            ./php-cli -c devel.ini ./bin/phpdc.phpr sample.php "$@" | tee decompiled.php
     250            ;;
     251        *)
     252            ./php-cli -c devel.ini ./bin/phpdc.phpr "$@" | tee decompiled.php
     253            ;;
     254        esac
    245255        return
    246256        ;;
     
    348358
    349359for phpbasename in "${dirs[@]}"; do
     360    phpVersion=${phpbasename%%-*}
     361    phpVersion=${phpVersion##php}
     362    phpVersion=${phpVersion/./}
     363    case "$phpVersion" in
     364    ??) phpVersion="${phpVersion}0";;
     365    ?) phpVersion="${phpVersion}00";;
     366    esac
     367
    350368    # devel actions
    351369    case "$1" in
Note: See TracChangeset for help on using the changeset viewer.