Ignore:
Timestamp:
2010/12/02 18:14:39 (12 years ago)
Author:
nanasess
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
Message:

#627(ソース整形・ソースコメントの改善)

  • 仮定義の関数名を修正
  • フォーマットを修正
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/SC_Response.php

    r19675 r19705  
    11<?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 */ 
    330class SC_Response{ 
    431 
    532    /** 
    6      * 
    7      * @var HTTP_Response 
    8      */ 
    9     var $http; 
    10     /** 
    11      * コンテンツタイプ 
     33     * コンテンツタイプ 
    1234     * Enter description here ... 
    1335     * @var unknown_type 
     
    1941 
    2042    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        ); 
    6385 
    6486 
     
    6991    var $encoding; 
    7092 
    71     function SC_Response(){ 
     93    function SC_Response() { 
    7294    } 
    7395 
    74     function response(){ 
     96    /** 
     97     * レスポンス出力を書き込む. 
     98     */ 
     99    function write() { 
    75100        $this->sendHeader(); 
    76                  
    77101        echo $this->body; 
    78102    } 
    79103 
    80     function sendHeader(){ 
    81         // HTTPのヘッダ 
     104    function sendHeader() { 
     105        // HTTPのヘッ 
    82106        //        header('HTTP/1.1 '.$this->statuscode.' '.$this->statusTexts[$this->statuscode]); 
    83107        foreach ($this->header as $name => $head){ 
     
    87111 
    88112 
    89     function setContentType($contentType){ 
     113    function setContentType($contentType) { 
    90114        $this->header['Content-Type'] = $contentType; 
    91115    } 
     
    95119    } 
    96120 
    97     /* function addDateHdeader($name, $date){ 
    98      * 
    99      * } 
    100      */ 
    101  
    102     function addHeader($name, $value){ 
     121    function addHeader($name, $value) { 
    103122        $this->header[$name] = $value; 
    104123    } 
    105124 
    106     function containsHeader($name){ 
     125    function containsHeader($name) { 
    107126        return isset($this->header[$name]); 
    108127    } 
    109128 
    110     function sendError($errorcode){ 
     129    function sendError($errorcode) { 
    111130        header('HTTP/1.1 '.$errorcode.' '.$this->statusTexts[$errorcode]); 
    112131    } 
    113132 
    114     function sendRedirect($location){ 
     133    function sendRedirect($location) { 
    115134        if (preg_match("/(" . preg_quote(SITE_URL, '/') 
    116135                          . "|" . preg_quote(SSL_URL, '/') . ")/", $location)) { 
     
    152171    } 
    153172 
    154     function setHeader($headers){ 
     173    function setHeader($headers) { 
    155174        $this->header = $headers; 
    156175    } 
    157176 
    158     function setStatus($sc = 202){ 
     177    function setStatus($sc = 202) { 
    159178        $this->statuscode = $sc; 
    160179    } 
Note: See TracChangeset for help on using the changeset viewer.