Changeset 19705 for branches/version-2_5-dev/data/class/SC_Response.php
- Timestamp:
- 2010/12/02 18:14:39 (12 years ago)
- bzr:base-revision:
- svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:19704
- bzr:committer:
- Kentaro Ohkouchi <ohkouchi@loop-az.jp>
- bzr:file-ids:
data/class/SC_Display.php 18986@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcamp%2Fcamp-2_5-E%2Fdata%2Fclass%2FSC_Display.php
data/class/SC_Response.php 18986@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcamp%2Fcamp-2_5-E%2Fdata%2Fclass%2FSC_Response.php
data/class/SC_SmartphoneUserAgent.php 19029@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcamp%2Fcamp-2_5-E%2Fdata%2Fclass%2FSC_SmartphoneUserAgent.php
data/class/pages/LC_Page.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2FLC_Page.php
data/class/pages/admin/LC_Page_Admin.php 15280@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2FLC_Page_Admin.php- bzr:mapping-version:
- v4
- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- ohkouchi@loop-az.jp-20101202091436-vcp9ha97310kgcx0
- bzr:revno:
- 2434
- bzr:revprop:branch-nick:
- branches/version-2_5-dev
- bzr:root:
- branches/version-2_5-dev
- bzr:timestamp:
- 2010-12-02 18:14:36.931999922 +0900
- bzr:user-agent:
- bzr2.2.1+bzr-svn1.0.4
- svn:original-date:
- 2010-12-02T09:14:36.932000Z
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/SC_Response.php
r19675 r19705 1 1 <?php 2 // TODO GPLのあれ 2 /* 3 * This file is part of EC-CUBE 4 * 5 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. 6 * 7 * http://www.lockon.co.jp/ 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License 11 * as published by the Free Software Foundation; either version 2 12 * of the License, or (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 */ 23 24 /** 25 * HttpResponse を扱うクラス. 26 * 27 * @author Ryuichi Tokugami 28 * @version $Id$ 29 */ 3 30 class SC_Response{ 4 31 5 32 /** 6 * 7 * @var HTTP_Response 8 */ 9 var $http; 10 /** 11 * コンテンツタイプ 33 * コンテンツタイプ 12 34 * Enter description here ... 13 35 * @var unknown_type … … 19 41 20 42 var $statusTexts = array( 21 '100' => 'Continue',22 '101' => 'Switching Protocols',23 '200' => 'OK',24 '201' => 'Created',25 '202' => 'Accepted',26 '203' => 'Non-Authoritative Information',27 '204' => 'No Content',28 '205' => 'Reset Content',29 '206' => 'Partial Content',30 '300' => 'Multiple Choices',31 '301' => 'Moved Permanently',32 '302' => 'Found',33 '303' => 'See Other',34 '304' => 'Not Modified',35 '305' => 'Use Proxy',36 '306' => '(Unused)',37 '307' => 'Temporary Redirect',38 '400' => 'Bad Request',39 '401' => 'Unauthorized',40 '402' => 'Payment Required',41 '403' => 'Forbidden',42 '404' => 'Not Found',43 '405' => 'Method Not Allowed',44 '406' => 'Not Acceptable',45 '407' => 'Proxy Authentication Required',46 '408' => 'Request Timeout',47 '409' => 'Conflict',48 '410' => 'Gone',49 '411' => 'Length Required',50 '412' => 'Precondition Failed',51 '413' => 'Request Entity Too Large',52 '414' => 'Request-URI Too Long',53 '415' => 'Unsupported Media Type',54 '416' => 'Requested Range Not Satisfiable',55 '417' => 'Expectation Failed',56 '500' => 'Internal Server Error',57 '501' => 'Not Implemented',58 '502' => 'Bad Gateway',59 '503' => 'Service Unavailable',60 '504' => 'Gateway Timeout',61 '505' => 'HTTP Version Not Supported',62 );43 '100' => 'Continue', 44 '101' => 'Switching Protocols', 45 '200' => 'OK', 46 '201' => 'Created', 47 '202' => 'Accepted', 48 '203' => 'Non-Authoritative Information', 49 '204' => 'No Content', 50 '205' => 'Reset Content', 51 '206' => 'Partial Content', 52 '300' => 'Multiple Choices', 53 '301' => 'Moved Permanently', 54 '302' => 'Found', 55 '303' => 'See Other', 56 '304' => 'Not Modified', 57 '305' => 'Use Proxy', 58 '306' => '(Unused)', 59 '307' => 'Temporary Redirect', 60 '400' => 'Bad Request', 61 '401' => 'Unauthorized', 62 '402' => 'Payment Required', 63 '403' => 'Forbidden', 64 '404' => 'Not Found', 65 '405' => 'Method Not Allowed', 66 '406' => 'Not Acceptable', 67 '407' => 'Proxy Authentication Required', 68 '408' => 'Request Timeout', 69 '409' => 'Conflict', 70 '410' => 'Gone', 71 '411' => 'Length Required', 72 '412' => 'Precondition Failed', 73 '413' => 'Request Entity Too Large', 74 '414' => 'Request-URI Too Long', 75 '415' => 'Unsupported Media Type', 76 '416' => 'Requested Range Not Satisfiable', 77 '417' => 'Expectation Failed', 78 '500' => 'Internal Server Error', 79 '501' => 'Not Implemented', 80 '502' => 'Bad Gateway', 81 '503' => 'Service Unavailable', 82 '504' => 'Gateway Timeout', 83 '505' => 'HTTP Version Not Supported', 84 ); 63 85 64 86 … … 69 91 var $encoding; 70 92 71 function SC_Response() {93 function SC_Response() { 72 94 } 73 95 74 function response(){ 96 /** 97 * レスポンス出力を書き込む. 98 */ 99 function write() { 75 100 $this->sendHeader(); 76 77 101 echo $this->body; 78 102 } 79 103 80 function sendHeader() {81 // HTTPのヘッ ダ104 function sendHeader() { 105 // HTTPのヘッダ 82 106 // header('HTTP/1.1 '.$this->statuscode.' '.$this->statusTexts[$this->statuscode]); 83 107 foreach ($this->header as $name => $head){ … … 87 111 88 112 89 function setContentType($contentType) {113 function setContentType($contentType) { 90 114 $this->header['Content-Type'] = $contentType; 91 115 } … … 95 119 } 96 120 97 /* function addDateHdeader($name, $date){ 98 * 99 * } 100 */ 101 102 function addHeader($name, $value){ 121 function addHeader($name, $value) { 103 122 $this->header[$name] = $value; 104 123 } 105 124 106 function containsHeader($name) {125 function containsHeader($name) { 107 126 return isset($this->header[$name]); 108 127 } 109 128 110 function sendError($errorcode) {129 function sendError($errorcode) { 111 130 header('HTTP/1.1 '.$errorcode.' '.$this->statusTexts[$errorcode]); 112 131 } 113 132 114 function sendRedirect($location) {133 function sendRedirect($location) { 115 134 if (preg_match("/(" . preg_quote(SITE_URL, '/') 116 135 . "|" . preg_quote(SSL_URL, '/') . ")/", $location)) { … … 152 171 } 153 172 154 function setHeader($headers) {173 function setHeader($headers) { 155 174 $this->header = $headers; 156 175 } 157 176 158 function setStatus($sc = 202) {177 function setStatus($sc = 202) { 159 178 $this->statuscode = $sc; 160 179 }
Note: See TracChangeset
for help on using the changeset viewer.