Changeset 20960 for branches/version-2_11-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php
- Timestamp:
- 2011/05/28 17:13:18 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php
r20952 r20960 103 103 $this->arrErr = $objFormParam->checkError(); 104 104 $this->arrForm = $objFormParam->getHashArray(); 105 $this->tpl_skip_update_csv = !defined('ZIP_DOWNLOAD_URL') || strlen(ZIP_DOWNLOAD_URL) === 0 || ZIP_DOWNLOAD_URL === false; 105 106 106 107 if ($this->exec) { … … 159 160 $objQuery =& SC_Query_Ex::getSingletonInstance(); 160 161 161 $this->lfDownloadZipFileFromJp(); 162 $this->lfExtractZipFile(); 162 if (!$this->tpl_skip_update_csv) { 163 $this->lfDownloadZipFileFromJp(); 164 $this->lfExtractZipFile(); 165 } 163 166 164 167 $objQuery->begin(); … … 362 365 */ 363 366 function lfDownloadZipFileFromJp() { 364 // Proxy経由を可能とする。 365 // TODO Proxyの設定は「DATA_REALDIR . 'module/Request.php'」内の「function HTTP_Request」へ記述する。いずれは、外部設定としたい。 366 $req = new HTTP_Request(); 367 $req->setURL(ZIP_DOWNLOAD_URL); 367 // Proxy経由を可能とする。 368 // TODO Proxyの設定は「DATA_REALDIR . 'module/Request.php'」内の「function HTTP_Request」へ記述する。いずれは、外部設定としたい。 369 $req = new HTTP_Request(); 370 371 $req->setURL(ZIP_DOWNLOAD_URL); 368 372 369 373 // 郵便番号CSVをdownloadする。 370 $res1 = $req->sendRequest(); 371 372 if ($res1) { 373 // 郵便番号CSV(zip file)を保存する。 374 $fp = fopen($this->zip_csv_temp_realfile, 'w'); 375 $res2 = fwrite($fp, $req->getResponseBody()); 376 } 377 if (!$res1 or !$res2) { 378 // 郵便番号CSVの「downloadに失敗」または「書き込みに失敗」 379 SC_Utils_Ex::sfDispException(ZIP_DOWNLOAD_URL . ' の取得または ' . $this->zip_csv_temp_realfile . ' への書き込みに失敗しました。'); 380 } 381 } 374 $res = $req->sendRequest(); 375 if (!$res) { 376 SC_Utils_Ex::sfDispException(ZIP_DOWNLOAD_URL . ' の取得に失敗しました。'); 377 } 378 379 // 郵便番号CSV(zip file)を保存する。 380 $fp = fopen($this->zip_csv_temp_realfile, 'w'); 381 if (!$fp) { 382 SC_Utils_Ex::sfDispException($this->zip_csv_temp_realfile . ' を開けません。'); 383 } 384 $res = fwrite($fp, $req->getResponseBody()); 385 if (!$res) { 386 SC_Utils_Ex::sfDispException($this->zip_csv_temp_realfile . ' への書き込みに失敗しました。'); 387 } 388 } 382 389 383 390 /**
Note: See TracChangeset
for help on using the changeset viewer.