Changeset 16483 for branches


Ignore:
Timestamp:
2007/10/17 19:55:38 (16 years ago)
Author:
adachi
Message:

ダウンロード完了通知処理を追加

File:
1 edited

Legend:

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

    r16464 r16483  
    189189            $arrCopyLog = $objBatch->execute($exract_dir); 
    190190 
     191            $this->notifyDownload($resp->getResponseCookies(), $objRet->product_data); 
    191192            // テーブルの更新 
    192193            // $this->updateMdlTable($objRet); 
     
    235236        } 
    236237    } 
     238 
     239    /** 
     240     * 配信サーバへダウンロード完了を通知する. 
     241     * 
     242     * @param array #arrCookies Cookie配列 
     243     * @retrun 
     244     */ 
     245    function notifyDownload($arrCookies) { 
     246        $objReq = new HTTP_Request(); 
     247        $objReq->setUrl('http://cube-shopaccount/upgrade/index.php'); 
     248        $objReq->setMethod('POST'); 
     249        $objReq->addPostData('mode', 'download_log'); 
     250 
     251        // Cookie追加 
     252        foreach ($arrCookies as $cookie) { 
     253            $objReq->addCookie($cookie['name'], $cookie['value']); 
     254        } 
     255 
     256        $e = $objReq->sendRequest(); 
     257        if (PEAR::isError($e)) { 
     258            $arrErr = array( 
     259                'status'  => OWNERSSTORE_STATUS_ERROR, 
     260                'errcode' => 999, 
     261                'body'    => '配信サーバとの通信中にエラーが発生しました。エラーコード:' . 999 
     262            ); 
     263            return $arrErr; 
     264        } 
     265 
     266        if ($objReq->getResponseCode() !== 200) { 
     267            $arrErr = array( 
     268                'status'  => OWNERSSTORE_STATUS_ERROR, 
     269                'errcode' => 999, 
     270                'body'    => '配信サーバとの通信中にエラーが発生しました。エラーコード:' . 999 
     271            ); 
     272            return $arrErr; 
     273        } 
     274        echo $objReq->getResponseBody(); 
     275        // TODO STATUSチェック 
     276        return true; 
     277    } 
    237278} 
    238279?> 
Note: See TracChangeset for help on using the changeset viewer.