Skip to content

Commit

Permalink
Merge pull request #389 from nobuhiko/fixownersstore
Browse files Browse the repository at this point in the history
2.17系だと2.13系のモジュールをインストールが出来ない問題を強引に解決する
  • Loading branch information
okazy authored May 28, 2020
2 parents 1b7d82b + 949c42e commit a6de307
Showing 1 changed file with 65 additions and 1 deletion.
66 changes: 65 additions & 1 deletion data/class/pages/upgrade/LC_Page_Upgrade_ProductsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,72 @@ public function process($mode)
$arrProducts = array();

foreach ($objRet->data as $product) {
$arrProducts[] = get_object_vars($product);
$tmp = get_object_vars($product);

if ($tmp['download_flg'] == 1) {
$arrProducts[$tmp['product_id']] = $tmp;
}
}

// todo 苦肉の策

// 再度リクエストを開始
$objLog->log('* http request start');
$arrPostData = array(
'eccube_url' => HTTP_URL,
'public_key' => sha1($public_key . $sha1_key),
'sha1_key' => $sha1_key,
'ver' => "2.13.17" // 2.13系も取得する
);
$objReq = $this->request('products_list', $arrPostData);

// リクエストチェック
$objLog->log('* http request check start');
if (PEAR::isError($objReq)) {
$objJson->setError(OSTORE_E_C_HTTP_REQ);
$objJson->display();
$objLog->error(OSTORE_E_C_HTTP_REQ, $objReq);

return;
}

// レスポンスチェック
$objLog->log('* http response check start');
if ($objReq->getResponseCode() !== 200) {
$objJson->setError(OSTORE_E_C_HTTP_RESP);
$objJson->display();
$objLog->error(OSTORE_E_C_HTTP_RESP, $objReq);

return;
}

$body = $objReq->getResponseBody();
$objRet = $objJson->decode($body);

// JSONデータのチェック
$objLog->log('* json deta check start');
if (empty($objRet)) {
$objJson->setError(OSTORE_E_C_FAILED_JSON_PARSE);
$objJson->display();
$objLog->error(OSTORE_E_C_FAILED_JSON_PARSE, $objReq);

return;
}

if ($objRet->status === OSTORE_STATUS_SUCCESS) {
$objLog->log('* get products list ok');

foreach ($objRet->data as $product) {
$tmp = get_object_vars($product);
if (!isset($arrProducts[$tmp['product_id']])) {
if ($tmp['download_flg'] == 1) {
$tmp['status'] = "2.13系のモジュールは十分に動作確認できてない場合があります" ;
}
$arrProducts[$tmp['product_id']] = $tmp;
}
}
}

$objView = new SC_AdminView_Ex();
$objView->assign('arrProducts', $arrProducts);

Expand Down

0 comments on commit a6de307

Please sign in to comment.