@@ 18-31 (lines=14) @@ | ||
15 | $code = 500; |
|
16 | } |
|
17 | ||
18 | function desc() |
|
19 | { |
|
20 | global $code; |
|
21 | switch ($code) { |
|
22 | case 400: |
|
23 | return 'Bad Request'; |
|
24 | case 401: |
|
25 | return 'Unauthorized'; |
|
26 | case 403: |
|
27 | return 'Forbidden'; |
|
28 | case 404: |
|
29 | return 'Not Found'; |
|
30 | case 500: |
|
31 | return 'Internal Server Error'; |
|
32 | case 501: |
|
33 | return 'Not Implemented'; |
|
34 | case 502: |
@@ 96-120 (lines=25) @@ | ||
93 | header('Status: '.$code.' '.self::getResponseType($code)); |
|
94 | } |
|
95 | ||
96 | protected static function getResponseType($code) |
|
97 | { |
|
98 | switch ($code) { |
|
99 | case 304: |
|
100 | return 'Not Modified'; |
|
101 | case 400: |
|
102 | return 'Bad Request'; |
|
103 | case 401: |
|
104 | return 'Unauthorized'; |
|
105 | case 403: |
|
106 | return 'Forbidden'; |
|
107 | case 404: |
|
108 | return 'Not Found'; |
|
109 | case 500: |
|
110 | return 'Internal Server Error'; |
|
111 | case 501: |
|
112 | return 'Not Implemented'; |
|
113 | case 502: |
|
114 | return 'Bad Gateway'; |
|
115 | case 503: |
|
116 | return 'Service Unavailable'; |
|
117 | case 504: |
|
118 | return 'Bad Timeout'; |
|
119 | } |
|
120 | } |
|
121 | ||
122 | public function setRedirect($url = self::REDIRECT_SELF) |
|
123 | { |