|
|
@ -9,8 +9,9 @@ $filenames = scandir(SAMPLE_DIR); |
|
|
|
$filenames = array_values(array_diff($filenames, ['.', '..'])); |
|
|
|
|
|
|
|
foreach ($filenames as $key => $filename) { |
|
|
|
echo $filename, PHP_EOL; |
|
|
|
$code = file_get_contents(SAMPLE_DIR . '/' . $filename); |
|
|
|
$path = SAMPLE_DIR . '/' . $filename; |
|
|
|
echo $path, PHP_EOL; |
|
|
|
$code = file_get_contents($path); |
|
|
|
try { |
|
|
|
$code = \Ganlv\EnphpDecoder\AutoDecoder::decode($code); |
|
|
|
echo $code, PHP_EOL; |
|
|
@ -19,3 +20,23 @@ foreach ($filenames as $key => $filename) { |
|
|
|
exit(1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
define('BUG_SAMPLE_DIR', __DIR__ . '/bug_samples'); |
|
|
|
$filenames = scandir(BUG_SAMPLE_DIR); |
|
|
|
$filenames = array_values(array_diff($filenames, ['.', '..'])); |
|
|
|
|
|
|
|
foreach ($filenames as $key => $filename) { |
|
|
|
$path = BUG_SAMPLE_DIR . '/' . $filename; |
|
|
|
echo $path, PHP_EOL; |
|
|
|
$code = file_get_contents($path); |
|
|
|
try { |
|
|
|
$code = \Ganlv\EnphpDecoder\AutoDecoder::decode($code); |
|
|
|
echo $code, PHP_EOL; |
|
|
|
exit(3); |
|
|
|
} catch (\Ganlv\EnphpDecoder\KnownEnphpBugs\KnownEnphpBugsException $e) { |
|
|
|
echo 'KnownEnphpBugsException: ', $e->getMessage(), PHP_EOL; |
|
|
|
} catch (Exception $e) { |
|
|
|
echo $e->getTraceAsString(); |
|
|
|
exit(2); |
|
|
|
} |
|
|
|
} |