Changeset 19817 for branches/version-2_5-dev/data/class/pages/LC_Page.php
- Timestamp:
- 2011/01/04 20:06:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/LC_Page.php
r19805 r19817 471 471 return sha1(uniqid(rand(), true)); 472 472 } 473 474 /**475 * HTTPステータスコードを送出する。476 *477 * @param integer $code HTTPステータスコード478 * @return void479 * @author Seasoft (新規作成)480 * @see Moony_Action::status() (オリジナル)481 * @link http://moony.googlecode.com/ (オリジナル)482 * @author YAMAOKA Hiroyuki (オリジナル)483 * @copyright 2005-2008 YAMAOKA Hiroyuki (オリジナル)484 * @license http://opensource.org/licenses/bsd-license.php New BSD License (オリジナル)485 * @link http://ja.wikipedia.org/wiki/HTTP%E3%82%B9%E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89 (邦訳)486 * @license http://www.gnu.org/licenses/fdl.html GFDL (邦訳)487 */488 function sendHttpStatus($code) {489 $protocol = $_SERVER['SERVER_PROTOCOL'];490 $httpVersion = (strpos($protocol, '1.1') !== false) ? '1.1' : '1.0';491 $messages = array(492 // Informational 1xx // 【情報】493 100 => 'Continue', // 継続494 101 => 'Switching Protocols', // プロトコル切替え495 // Success 2xx // 【成功】496 200 => 'OK', // OK497 201 => 'Created', // 作成498 202 => 'Accepted', // 受理499 203 => 'Non-Authoritative Information', // 信頼できない情報500 204 => 'No Content', // 内容なし501 205 => 'Reset Content', // 内容のリセット502 206 => 'Partial Content', // 部分的内容503 // Redirection 3xx // 【リダイレクション】504 300 => 'Multiple Choices', // 複数の選択505 301 => 'Moved Permanently', // 恒久的に移動した506 302 => 'Found', // 1.1 // 発見した (リクエストしたリソースは一時的に移動されているときに返される)507 303 => 'See Other', // 他を参照せよ508 304 => 'Not Modified', // 未更新509 305 => 'Use Proxy', // プロキシを使用せよ510 // 306 is no longer used but still reserved // 将来のために予約されている511 307 => 'Temporary Redirect', // 一時的リダイレクト512 // Client Error 4xx // 【クライアントエラー】513 400 => 'Bad Request', // リクエストが不正である514 401 => 'Unauthorized', // 認証が必要である515 402 => 'Payment Required', // 支払いが必要である516 403 => 'Forbidden', // 禁止されている517 404 => 'Not Found', // 未検出518 405 => 'Method Not Allowed', // 許可されていないメソッド519 406 => 'Not Acceptable', // 受理できない520 407 => 'Proxy Authentication Required', // プロキシ認証が必要である521 408 => 'Request Timeout', // リクエストタイムアウト522 409 => 'Conflict', // 矛盾523 410 => 'Gone', // 消滅した524 411 => 'Length Required', // 長さが必要525 412 => 'Precondition Failed', // 前提条件で失敗した526 413 => 'Request Entity Too Large', // リクエストエンティティが大きすぎる527 414 => 'Request-URI Too Long', // リクエストURIが大きすぎる528 415 => 'Unsupported Media Type', // サポートしていないメディアタイプ529 416 => 'Requested Range Not Satisfiable', // リクエストしたレンジは範囲外にある530 417 => 'Expectation Failed', // 期待するヘッダに失敗531 // Server Error 5xx // 【サーバエラー】532 500 => 'Internal Server Error', // サーバ内部エラー533 501 => 'Not Implemented', // 実装されていない534 502 => 'Bad Gateway', // 不正なゲートウェイ535 503 => 'Service Unavailable', // サービス利用不可536 504 => 'Gateway Timeout', // ゲートウェイタイムアウト537 505 => 'HTTP Version Not Supported', // サポートしていないHTTPバージョン538 509 => 'Bandwidth Limit Exceeded' // 帯域幅制限超過539 );540 if (isset($messages[$code])) {541 if ($httpVersion !== '1.1') {542 // HTTP/1.0543 $messages[302] = 'Moved Temporarily';544 }545 header("HTTP/{$httpVersion} {$code} {$messages[$code]}");546 header("Status: {$code} {$messages[$code]}", true, $code);547 }548 }549 473 } 550 474 ?>
Note: See TracChangeset
for help on using the changeset viewer.