| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public static function to($location = "", $errCode=null, $replaceMessage=null) |
||
| 32 | { |
||
| 33 | if ($location) { |
||
| 34 | if ($location === 404) { |
||
| 35 | |||
| 36 | http_response_code(404); |
||
| 37 | $errorStrings = json_decode(file_get_contents(VDIR.'/errorStrings.json'), true); |
||
| 38 | $errorString = $errorStrings[$errCode]; |
||
| 39 | $errorString = str_replace('@errMessage', $replaceMessage, $errorString); |
||
| 40 | |||
| 41 | extract($errorString); |
||
| 42 | |||
| 43 | ob_start(); |
||
| 44 | |||
| 45 | require VDIR . '/template/404.php'; |
||
| 46 | |||
| 47 | echo ob_get_clean(); |
||
| 48 | } else { |
||
| 49 | header("Location: " . $location); |
||
| 50 | // header("Location: /index.php?url=login"); |
||
| 51 | } |
||
| 52 | exit; |
||
| 53 | } |
||
| 57 |