File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 99$ filenames = array_values (array_diff ($ filenames , ['. ' , '.. ' ]));
1010
1111foreach ($ filenames as $ key => $ filename ) {
12- echo $ filename , PHP_EOL ;
13- $ code = file_get_contents (SAMPLE_DIR . '/ ' . $ filename );
12+ $ path = SAMPLE_DIR . '/ ' . $ filename ;
13+ echo $ path , PHP_EOL ;
14+ $ code = file_get_contents ($ path );
1415 try {
1516 $ code = \Ganlv \EnphpDecoder \AutoDecoder::decode ($ code );
1617 echo $ code , PHP_EOL ;
1920 exit (1 );
2021 }
2122}
23+
24+ define ('BUG_SAMPLE_DIR ' , __DIR__ . '/bug_samples ' );
25+ $ filenames = scandir (BUG_SAMPLE_DIR );
26+ $ filenames = array_values (array_diff ($ filenames , ['. ' , '.. ' ]));
27+
28+ foreach ($ filenames as $ key => $ filename ) {
29+ $ path = BUG_SAMPLE_DIR . '/ ' . $ filename ;
30+ echo $ path , PHP_EOL ;
31+ $ code = file_get_contents ($ path );
32+ try {
33+ $ code = \Ganlv \EnphpDecoder \AutoDecoder::decode ($ code );
34+ echo $ code , PHP_EOL ;
35+ exit (3 );
36+ } catch (\Ganlv \EnphpDecoder \KnownEnphpBugs \KnownEnphpBugsException $ e ) {
37+ echo 'KnownEnphpBugsException: ' , $ e ->getMessage (), PHP_EOL ;
38+ } catch (Exception $ e ) {
39+ echo $ e ->getTraceAsString ();
40+ exit (2 );
41+ }
42+ }
You can’t perform that action at this time.
0 commit comments