Ignore:
Timestamp:
2011/05/21 15:22:10 (13 years ago)
Author:
Seasoft
Message:

#144 (郵便番号DB のアップデート)

  • URLのパラメータ化
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php

    r20951 r20952  
    5555    /** CSV の更新日時 */ 
    5656    var $tpl_csv_datetime; 
    57  
    58     /** ZIP アーカイブファイルの取得元 */ 
    59     var $zip_download_url = 'http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip'; 
    6057 
    6158    /** 日本郵便から取得した ZIP アーカイブファイルの保管パス */ 
     
    147144        $this->tpl_csv_datetime = $this->lfGetCsvDatetime(); 
    148145        // XXX PHP4 を切捨てたら、ダウンロードの必要性チェックなども行いたい 
    149         // $arrHeader = get_headers($this->zip_download_url, 1); 
     146        // $arrHeader = get_headers(ZIP_DOWNLOAD_URL, 1); 
    150147    } 
    151148 
     
    364361     * @return void 
    365362     */ 
    366     function lfDownloadZipFileFromJp() { 
     363   function lfDownloadZipFileFromJp() { 
    367364       // Proxy経由を可能とする。         
    368365       // TODO Proxyの設定は「DATA_REALDIR . 'module/Request.php'」内の「function HTTP_Request」へ記述する。いずれは、外部設定としたい。 
    369366       $req = new HTTP_Request(); 
    370        $req->setURL($this->zip_download_url); 
    371         
     367       $req->setURL(ZIP_DOWNLOAD_URL); 
     368 
    372369        // 郵便番号CSVをdownloadする。 
    373370       $res1 = $req->sendRequest(); 
     
    377374           $fp = fopen($this->zip_csv_temp_realfile, 'w'); 
    378375           $res2 = fwrite($fp, $req->getResponseBody()); 
    379         } 
     376       } 
    380377       if (!$res1 or !$res2) { 
    381378            // 郵便番号CSVの「downloadに失敗」または「書き込みに失敗」 
    382            SC_Utils_Ex::sfDispException($this->zip_download_url . ' の取得または ' . $this->zip_csv_temp_realfile . ' への書き込みに失敗しました。'); 
     379           SC_Utils_Ex::sfDispException(ZIP_DOWNLOAD_URL . ' の取得または ' . $this->zip_csv_temp_realfile . ' への書き込みに失敗しました。'); 
    383380       } 
    384     } 
     381   } 
    385382 
    386383    /** 
Note: See TracChangeset for help on using the changeset viewer.