File tree 1 file changed +23
-2
lines changed
1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 9
9
$ filenames = array_values (array_diff ($ filenames , ['. ' , '.. ' ]));
10
10
11
11
foreach ($ 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 );
14
15
try {
15
16
$ code = \Ganlv \EnphpDecoder \AutoDecoder::decode ($ code );
16
17
echo $ code , PHP_EOL ;
19
20
exit (1 );
20
21
}
21
22
}
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