Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.17系だと2.13系のモジュールをインストールが出来ない問題を強引に解決する #389

Merged
merged 2 commits into from
May 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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