Class HttpResponseHeader

Description

HTTP Response Header Class

HTTP Response Header ClassはHTTP Responseをコントロールするクラスです。

  • author: http://purl.org/meta/me/
  • version: http_response_header.php 1.0 2011-08-20
  • access: public
  • license: Creative

Located in /http_response_header.php (line 13)


	
			
Variable Summary
static array $httpStatusCodes
static string $httpVersion
static array $httpVersions
Method Summary
string date ([integer $timestamp = null])
void expires (integer $time)
mixed getHeader ([mixed $name = null])
string getHttpVersion ()
mixed gzip ()
void header (mixed $headers, [mixed $replace = true], [boolean $_replace = true])
void htmlHeader ()
void noCache ()
mixed notModified ([boolean $exit = true])
void publicCache ()
mixed range ([string $content = null])
boolean server ([string $content = null])
boolean statusCode ([integer $status = 200], [string $httpVersion = null])
Variables
static array $httpStatusCodes = array(
100 => 'Continue',
101 => 'Switching Protocols',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
226 => 'IM Used',
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
307 => 'Temporary Redirect',
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required',
408 => 'Request Time-out',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed',
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Large',
415 => 'Unsupported Media Type',
416 => 'Requested range not satisfiable',
417 => 'Expectation Failed',
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Time-out',
505 => 'HTTP Version Not Supported',
509 => 'Bandwidth Limit Exceeded'
)
(line 23)

HTTP Status Codeの一覧。(ja)

List of HTTP Status Code.(en)

  • access: public
static string $httpVersion = '1.0' (line 76)

HTTPのバージョン。(ja)

HTTP Version.(en)

  • access: public
static array $httpVersions = array('1.0', '1.1') (line 86)

HTTPのバージョン。(ja)

Available HTTP Versions.(en)

  • access: public
Methods
date (line 125)

タイムスタンプをRFC 1123の日付形式に変換します。(ja)

  1.  HttpResponseHeader::date(1314600068);
  2.  
  3.  # 出力すると以下のようになります。
  4.  # Mon, 29 Aug 2011 06:41:08 GMT

  • return: RFC 1123の日付形式(ja) RFC 1123 date format(en)
  • access: public
string date ([integer $timestamp = null])
  • integer $timestamp: タイムスタンプ(ja) Timestamp(en)
expires (line 105)

有効期限を設定します。(ja)

Set the expiration date.(en)

  1.  
  2.  # 以下のようにレスポンスヘッダーを出力します。
  3.  # Cache-Control: max-age=3600
  4.  # Expires: Mon, 29 Aug 2011 10:31:06 GMT

  • access: public
void expires (integer $time)
  • integer $time: 有効期限までの秒数(ja) Expiration Seconds(en)
getHeader (line 142)

既に出力したHTTP Response Headerを取得します。(ja)

Get the HTTP Response Header output now.(en)

  • return: 文字列または配列(ja) string or array(en)
  • access: public
mixed getHeader ([mixed $name = null])
  • mixed $name: 取得したいフィールドを指定します。全てのフィールドを取得したい場合値は空でよいです。(ja) Specify the field to get.(en)
getHttpVersion (line 174)

リクエストされたHTTPのバージョン。(ja)

Version of the HTTP request.(en)

  • return: HTTPのバージョン(ja) HTTP Version(en)
  • access: public
string getHttpVersion ()
gzip (line 198)

gzipのエンコードを開始します。(ja)

Start the encoding of gzip.(en)

  1.  
  2.  # 以下のようにレスポンスヘッダーを出力します。
  3.  # Vary: Accept-Encoding
  4.  # Content-Encoding: gzip

  • return: 成功した場合はContent-Encoding Headerの内容を、失敗した場合はfalseを返します。
  • access: public
mixed gzip ()
header (line 242)

HTTP Response Headerを出力します。(ja)

Print the HTTP Response Header(en)

  1.      'ETag' => 'Etag Field value',
  2.      'Content-MD5' => 'Content-MD5 Field value',
  3.      'Last-Modified' => 1314600068
  4.  ));
  5.  
  6.  # 以下のようにレスポンスヘッダーを出力します。
  7.  # Etag: "d4289a42770d87be5a78cbcefcc1e3b76a07f94dd1005020736b6943e0e65bf07d97472739fb775ea7a8107ce024864def444d935f494e096f2bfd0382bb2e84"
  8.  # Content-MD5: RhQI+teVkAukVCltE3K+yg==
  9.  # Last-Modified: Mon, 29 Aug 2011 06:41:08 GMT

  • access: public
void header (mixed $headers, [mixed $replace = true], [boolean $_replace = true])
  • mixed $headers: Headerの配列またはフィールド名(ja) Headers array or field name(en)
  • mixed $replace: 前に送信された類似のヘッダを置換するか。$headersがフィールド名の場合フィールドの内容
  • boolean $_replace
htmlHeader (line 290)

HTML用のHeaderを出力します。(ja)

Print the Header for HTML.(en)

  1.  
  2.  # 以下のようにレスポンスヘッダーを出力します。
  3.  # Content-Style-Type: text/css
  4.  # Content-Script-Type: text/javascript

  • access: public
void htmlHeader ()
noCache (line 315)

Webブラウザーがキャッシュしない様に指示します。(ja)

Instructs the Web browser not to cache.(en)

  1.  
  2.  # 以下のようにレスポンスヘッダーを出力します。
  3.  # Expires: Mon, 26 Jul 1997 05:00:00 GMT
  4.  # Last-Modified: Mon, 29 Aug 2011 07:15:22 GMT
  5.  # Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  6.  # Pragma: no-cache

  • access: public
void noCache ()
notModified (line 336)

条件が一致すれば"304 Not Modified"または"412 Precondition Failed"を出力します。(ja)

Print the "304 Not Modified" or "412 Precondition Failed" if the conditions are matched.(en)

  • access: public
mixed notModified ([boolean $exit = true])
  • boolean $exit: PHPを終了するならばtrue(ja) If True, the closing PHP(en)
publicCache (line 393)

パブリックなキャッシュをするように指示します。(ja)

Public Cache(en)

  1.  
  2.  # 以下のようにレスポンスヘッダーを出力します。
  3.  # Cache-Control: public
  4.  # Pragma: public

  • access: public
void publicCache ()
range (line 409)

範囲リクエストに対応します。(ja)

Corresponds to a Range Request.(en)

  • access: public
mixed range ([string $content = null])
  • string $content
server (line 509)

Serverの情報を出力します。(ja)

Print the Server information.(en)

  1.  HttpResponseHeader::server('Apache/2.2');
  2.  
  3.  # 以下のようにレスポンスヘッダーを出力します。
  4.  # Server: Apache/2.2

  • return: 成功ならばtrueを、失敗ならばfalseを返す。
  • access: public
boolean server ([string $content = null])
  • string $content
statusCode (line 540)

HTTP Status Codeを出力します。(ja)

Print the HTTP Status Code.(en)

  1.  
  2.  # 以下のようにレスポンスヘッダーを出力します。
  3.  # HTTP/1.1 404 Not Found

  • return: 成功ならばtrueを、失敗ならばfalseを返します。
  • access: public
boolean statusCode ([integer $status = 200], [string $httpVersion = null])
  • integer $status: HTTP Status Codeの番号(ja) The number of HTTP Status Code(en)
  • string $httpVersion: HTTPのバージョン(ja) HTTP Version(en)

Documentation generated on Mon, 29 Aug 2011 18:41:45 +0000 by phpDocumentor 1.4.3