1 | <?php |
||
16 | final class Highlighter |
||
17 | { |
||
18 | /** |
||
19 | * Highlighter with built-in check for list of disabled function (Google AppEngine) |
||
20 | * |
||
21 | * @param string $file Name of the file |
||
22 | */ |
||
23 | public static function highlight($file) |
||
24 | { |
||
25 | $highlightFileFunc = new \ReflectionFunction('highlight_file'); |
||
26 | if (!$highlightFileFunc->isDisabled()) { |
||
27 | highlight_file($file); |
||
28 | } else { |
||
29 | echo '<pre>' . htmlspecialchars(file_get_contents($file)) . '</pre>'; |
||
30 | } |
||
31 | } |
||
32 | } |
||
33 |