Ignore:
Timestamp:
2007/10/14 22:55:13 (19 years ago)
Author:
adachi
Message:

オーナーズストア連携暫定コミット

Location:
branches/feature-module-update/data/class/pages/upgrade
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_Base.php

    r16383 r16420  
    11<?php 
     2/* 
     3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 
     4 * 
     5 * http://www.lockon.co.jp/ 
     6 */ 
    27 
     8// {{{ requires 
     9require_once CLASS_PATH . 'pages/LC_Page.php'; 
     10 
     11/** 
     12 * オーナーズストア連携の基底クラス 
     13 * 
     14 * @package Page 
     15 * @author LOCKON CO.,LTD. 
     16 * @version $Id$ 
     17 */ 
     18class LC_Page_Upgrade_Base extends LC_Page { 
     19 
     20    // }}} 
     21    // {{{ functions 
     22 
     23    function LC_Page_Upgrade_Base() { 
     24        $this->objJson = new Services_Json(); 
     25    } 
     26    /** 
     27     * 配信サーバへリクエストを送信する. 
     28     * 
     29     * @param string $mode 
     30     * @param array $arrParams 追加パラメータ.連想配列で渡す. 
     31     * @return string|object レスポンスボディ|エラー時にはPEAR::Errorオブジェクトを返す. 
     32     */ 
     33    function request($mode, $arrParams = array()) { 
     34        $objReq = new HTTP_Request(); 
     35        $objReq->setUrl('http://cube-shopaccount/upgrade/index.php'); 
     36        $objReq->setMethod('POST'); 
     37        $objReq->addPostData('mode', $mode); 
     38        $objReq->addPostData('site_url', SITE_URL); 
     39        $objReq->addPostData('ssl_url', SSL_URL); 
     40        $objReq->addPostDataArray($arrParams); 
     41 
     42        $e = $objReq->sendRequest(); 
     43        if (PEAR::isError($e)) { 
     44            return $e; 
     45        } 
     46 
     47        if (($code = $objReq->getResponseCode()) !== 200) { 
     48            return PEAR::raiseError('HTTP RESPONSE CODE:' . $code); 
     49        } 
     50 
     51        return $objReq->getResponseBody(); 
     52    } 
     53 
     54    /** 
     55     * ユーザへ結果を通知する. 
     56     * 
     57     * @param integer $status ステータスコード 
     58     * @param string $message ステータスメッセージ 
     59     * @param array arrParam 追加パラメータ 
     60     * @return void 
     61     */ 
     62    function displayJson($status, $message, $arrParam = array()) { 
     63        $arrData = array( 
     64            'status'  => $status, 
     65            'body'    => $message 
     66        ); 
     67        echo $this->objJson->encode(array_merge($arrData, $arrParam)); 
     68    } 
     69 
     70    /** 
     71     * ログ出力を行う 
     72     * 
     73     * @param integer $message logメッセージ 
     74     * @param string $val debug用パラメータ 
     75     */ 
     76    function log($message, $val = null) { 
     77        $msg = sprintf("%s / debug: %s", $message, serialize($val)); 
     78        GC_Utils::gfPrintLog($msg, DATA_PATH . 'logs/ownersstore.log'); 
     79    } 
     80} 
    381?> 
  • branches/feature-module-update/data/class/pages/upgrade/LC_Page_Upgrade_ProductsList.php

    r16383 r16420  
    88// {{{ requires 
    99require_once CLASS_PATH . 'pages/LC_Page.php'; 
    10 require_once DATA_PATH  . 'module/Services/JSON.php'; 
    11 require_once DATA_PATH  . 'module/Request.php'; 
    1210 
    1311/** 
     
    3937    function process() { 
    4038        $objSess = new SC_Session(); 
    41         if ( $objSess->isSuccess() !== true) { 
     39        if ($objSess->isSuccess() !== true) { 
    4240            // TODO エラー処理 
    4341        } 
     
    7169        parent::destroy(); 
    7270    } 
    73  
    74  
    75     function createResponceHTML() {} 
    7671} 
    7772?> 
Note: See TracChangeset for help on using the changeset viewer.