Browse Source

phpdc: exit on decompile error

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1285 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.1
Xuefer 8 years ago
parent
commit
aee274ada1
  1. 10
      bin/phpdc.phpr
  2. 3
      lib/Decompiler.class.php

10
bin/phpdc.phpr

@ -14,10 +14,12 @@ if (!isset($argv)) {
$dc = new Decompiler();
if (isset($argv[2])) {
eval('$dc->dc = ' . file_get_contents($argv[2]) . ';');
eval('$dc->decompileDasm(' . file_get_contents($argv[2]) . ');');
}
else if (isset($argv[1])) {
$dc->decompileFile($argv[1]);
if ($dc->decompileFile($argv[1]) === false) {
exit(2);
}
}
else {
$phpcode = '';
@ -27,7 +29,9 @@ else {
while (!feof(stdin)) {
$phpcode .= fgets(stdin);
}
$dc->decompileString($phpcode);
if ($dc->decompileString($phpcode) === false) {
exit(2);
}
}
$dc->output();

3
lib/Decompiler.class.php

@ -2568,6 +2568,7 @@ class Decompiler
echo "error compling string\n";
return false;
}
return true;
}
// }}}
function decompileFile($file) // {{{
@ -2577,11 +2578,13 @@ class Decompiler
echo "error compling $file\n";
return false;
}
return true;
}
// }}}
function decompileDasm($content) // {{{
{
$this->dc = $content;
return true;
}
// }}}
function output() // {{{

Loading…
Cancel
Save