@@ -681,8 +681,8 @@ |
||
681 | 681 | * |
682 | 682 | * @param Request $request |
683 | 683 | * @param $authKey |
684 | - * @param $url |
|
685 | - * @param $app |
|
684 | + * @param string $url |
|
685 | + * @param Application $app |
|
686 | 686 | * @return array |
687 | 687 | */ |
688 | 688 | private function getRequestApi(Request $request, $authKey, $url, $app) |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | foreach ($Plugins as $Plugin) { |
64 | 64 | |
65 | 65 | $form = $app['form.factory'] |
66 | - ->createNamedBuilder('form' . $Plugin->getId(), 'plugin_management', null, array( |
|
66 | + ->createNamedBuilder('form'.$Plugin->getId(), 'plugin_management', null, array( |
|
67 | 67 | 'plugin_id' => $Plugin->getId(), |
68 | 68 | )) |
69 | 69 | ->getForm(); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | try { |
74 | 74 | // プラグイン用設定画面があれば表示(プラグイン用のサービスプロバイダーに定義されているか) |
75 | - $configPages[$Plugin->getCode()] = $app->url('plugin_' . $Plugin->getCode() . '_config'); |
|
75 | + $configPages[$Plugin->getCode()] = $app->url('plugin_'.$Plugin->getCode().'_config'); |
|
76 | 76 | } catch (\Exception $e) { |
77 | 77 | // プラグインで設定画面のルートが定義されていない場合は無視 |
78 | 78 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | if (!is_null($authKey)) { |
95 | 95 | |
96 | 96 | // オーナーズストア通信 |
97 | - $url = $app['config']['owners_store_url'] . '?method=list'; |
|
97 | + $url = $app['config']['owners_store_url'].'?method=list'; |
|
98 | 98 | list($json, $info) = $this->getRequestApi($request, $authKey, $url, $app); |
99 | 99 | |
100 | 100 | if ($json) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $Plugin = $app['eccube.repository.plugin']->find($id); |
156 | 156 | |
157 | 157 | $form = $app['form.factory'] |
158 | - ->createNamedBuilder('form' . $id, 'plugin_management', null, array( |
|
158 | + ->createNamedBuilder('form'.$id, 'plugin_management', null, array( |
|
159 | 159 | 'plugin_id' => null, // placeHolder |
160 | 160 | )) |
161 | 161 | ->getForm(); |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | $formFile = $form['plugin_archive']->getData(); |
174 | 174 | |
175 | 175 | $tmpDir = $app['eccube.service.plugin']->createTempDir(); |
176 | - $tmpFile = sha1(Str::random(32)) . '.' . $formFile->getClientOriginalExtension(); |
|
176 | + $tmpFile = sha1(Str::random(32)).'.'.$formFile->getClientOriginalExtension(); |
|
177 | 177 | |
178 | 178 | $formFile->move($tmpDir, $tmpFile); |
179 | - $app['eccube.service.plugin']->update($Plugin, $tmpDir . '/' . $tmpFile); |
|
179 | + $app['eccube.service.plugin']->update($Plugin, $tmpDir.'/'.$tmpFile); |
|
180 | 180 | |
181 | 181 | $fs = new Filesystem(); |
182 | 182 | $fs->remove($tmpDir); |
@@ -345,11 +345,11 @@ discard block |
||
345 | 345 | $formFile = $form['plugin_archive']->getData(); |
346 | 346 | |
347 | 347 | $tmpDir = $service->createTempDir(); |
348 | - $tmpFile = sha1(Str::random(32)) . '.' . $formFile->getClientOriginalExtension(); // 拡張子を付けないとpharが動かないので付ける |
|
348 | + $tmpFile = sha1(Str::random(32)).'.'.$formFile->getClientOriginalExtension(); // 拡張子を付けないとpharが動かないので付ける |
|
349 | 349 | |
350 | 350 | $formFile->move($tmpDir, $tmpFile); |
351 | 351 | |
352 | - $service->install($tmpDir . '/' . $tmpFile); |
|
352 | + $service->install($tmpDir.'/'.$tmpFile); |
|
353 | 353 | |
354 | 354 | $fs = new Filesystem(); |
355 | 355 | $fs->remove($tmpDir); |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | if (!is_null($authKey)) { |
397 | 397 | |
398 | 398 | // オーナーズストア通信 |
399 | - $url = $app['config']['owners_store_url'] . '?method=list'; |
|
399 | + $url = $app['config']['owners_store_url'].'?method=list'; |
|
400 | 400 | list($json, $info) = $this->getRequestApi($request, $authKey, $url, $app); |
401 | 401 | |
402 | 402 | if ($json === false) { |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | } |
471 | 471 | |
472 | 472 | } else { |
473 | - $message = $data['error_code'] . ' : ' . $data['error_message']; |
|
473 | + $message = $data['error_code'].' : '.$data['error_message']; |
|
474 | 474 | } |
475 | 475 | } else { |
476 | 476 | $success = 0; |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | if (!is_null($authKey)) { |
513 | 513 | |
514 | 514 | // オーナーズストア通信 |
515 | - $url = $app['config']['owners_store_url'] . '?method=download&product_id=' . $id; |
|
515 | + $url = $app['config']['owners_store_url'].'?method=download&product_id='.$id; |
|
516 | 516 | list($json, $info) = $this->getRequestApi($request, $authKey, $url, $app); |
517 | 517 | |
518 | 518 | if ($json === false) { |
@@ -537,22 +537,22 @@ discard block |
||
537 | 537 | $extension = pathinfo($item['file_name'], PATHINFO_EXTENSION); |
538 | 538 | |
539 | 539 | $tmpDir = $service->createTempDir(); |
540 | - $tmpFile = sha1(Str::random(32)) . '.' . $extension; |
|
540 | + $tmpFile = sha1(Str::random(32)).'.'.$extension; |
|
541 | 541 | |
542 | 542 | // ファイル作成 |
543 | 543 | $fs = new Filesystem(); |
544 | - $fs->dumpFile($tmpDir . '/' . $tmpFile, $file); |
|
544 | + $fs->dumpFile($tmpDir.'/'.$tmpFile, $file); |
|
545 | 545 | |
546 | 546 | if ($action == 'install') { |
547 | 547 | |
548 | - $service->install($tmpDir . '/' . $tmpFile, $id); |
|
548 | + $service->install($tmpDir.'/'.$tmpFile, $id); |
|
549 | 549 | $app->addSuccess('admin.plugin.install.complete', 'admin'); |
550 | 550 | |
551 | 551 | } else if ($action == 'update') { |
552 | 552 | |
553 | 553 | $Plugin = $app['eccube.repository.plugin']->findOneBy(array('source' => $id)); |
554 | 554 | |
555 | - $service->update($Plugin, $tmpDir . '/' . $tmpFile); |
|
555 | + $service->update($Plugin, $tmpDir.'/'.$tmpFile); |
|
556 | 556 | $app->addSuccess('admin.plugin.update.complete', 'admin'); |
557 | 557 | |
558 | 558 | Cache::clear($app, false); |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | $fs->remove($tmpDir); |
564 | 564 | |
565 | 565 | // ダウンロード完了通知処理(正常終了時) |
566 | - $url = $app['config']['owners_store_url'] . '?method=commit&product_id=' . $id . '&status=1&version=' . $version; |
|
566 | + $url = $app['config']['owners_store_url'].'?method=commit&product_id='.$id.'&status=1&version='.$version; |
|
567 | 567 | $this->getRequestApi($request, $authKey, $url, $app); |
568 | 568 | |
569 | 569 | return $app->redirect($app->url('admin_store_plugin')); |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | } |
578 | 578 | |
579 | 579 | } else { |
580 | - $message = $data['error_code'] . ' : ' . $data['error_message']; |
|
580 | + $message = $data['error_code'].' : '.$data['error_message']; |
|
581 | 581 | } |
582 | 582 | } else { |
583 | 583 | $message = "EC-CUBEオーナーズストアにエラーが発生しています。"; |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | } |
587 | 587 | |
588 | 588 | // ダウンロード完了通知処理(エラー発生時) |
589 | - $url = $app['config']['owners_store_url'] . '?method=commit&product_id=' . $id . '&status=0&version=' . $version . '&message=' . urlencode($message); |
|
589 | + $url = $app['config']['owners_store_url'].'?method=commit&product_id='.$id.'&status=0&version='.$version.'&message='.urlencode($message); |
|
590 | 590 | $this->getRequestApi($request, $authKey, $url, $app); |
591 | 591 | |
592 | 592 | $app->addError($message, 'admin'); |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | $url = $app['config']['cacert_pem_url']; |
655 | 655 | |
656 | 656 | $curl = curl_init($url); |
657 | - $fileName = $app['config']['root_dir'] . '/app/config/eccube/' . $this->certFileName; |
|
657 | + $fileName = $app['config']['root_dir'].'/app/config/eccube/'.$this->certFileName; |
|
658 | 658 | $fp = fopen($fileName, 'w'); |
659 | 659 | |
660 | 660 | curl_setopt($curl, CURLOPT_FILE, $fp); |
@@ -692,9 +692,9 @@ discard block |
||
692 | 692 | $options = array( // オプション配列 |
693 | 693 | //HEADER |
694 | 694 | CURLOPT_HTTPHEADER => array( |
695 | - 'Authorization: ' . base64_encode($authKey), |
|
696 | - 'x-eccube-store-url: ' . base64_encode($request->getSchemeAndHttpHost() . $request->getBasePath()), |
|
697 | - 'x-eccube-store-version: ' . base64_encode(Constant::VERSION), |
|
695 | + 'Authorization: '.base64_encode($authKey), |
|
696 | + 'x-eccube-store-url: '.base64_encode($request->getSchemeAndHttpHost().$request->getBasePath()), |
|
697 | + 'x-eccube-store-version: '.base64_encode(Constant::VERSION), |
|
698 | 698 | ), |
699 | 699 | CURLOPT_HTTPGET => true, |
700 | 700 | CURLOPT_SSL_VERIFYPEER => true, |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | |
705 | 705 | curl_setopt_array($curl, $options); /// オプション値を設定 |
706 | 706 | |
707 | - $certFile = $app['config']['root_dir'] . '/app/config/eccube/'. $this->certFileName; |
|
707 | + $certFile = $app['config']['root_dir'].'/app/config/eccube/'.$this->certFileName; |
|
708 | 708 | if (file_exists($certFile)) { |
709 | 709 | // php5.6でサーバ上に適切な証明書がなければhttps通信エラーが発生するため、 |
710 | 710 | // http://curl.haxx.se/ca/cacert.pem を利用して通信する |