From 87ef152996cb31ca9cdb545e93bd4667098e06ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=AE=E3=83=AA=E3=83=B3=E3=82=B0=E3=83=8F=E3=83=A0?= =?UTF-8?q?=E3=83=94=E3=82=A2=E3=83=BC=E3=82=B9?= Date: Thu, 15 Sep 2022 10:55:24 +0900 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E5=89=8D=E7=A9=BA=E9=96=93=E5=90=8D?= =?UTF-8?q?=20=E3=83=AB=E3=83=BC=E3=83=86=E3=82=A3=E3=83=B3=E3=82=B0?= =?UTF-8?q?=E5=90=8D=20=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E5=90=8D=20?= =?UTF-8?q?=E3=83=80=E3=82=A6=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E3=83=91?= =?UTF-8?q?=E3=83=83=E3=82=B1=E3=83=BC=E3=82=B8=E5=90=8D=20=E3=81=AE?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=81=AF=E4=B8=8D=E8=A6=81=E3=81=AE=E3=81=9F?= =?UTF-8?q?=E3=82=81=E3=80=81=E5=85=83=E3=81=AE=E7=8A=B6=E6=85=8B=E3=81=AB?= =?UTF-8?q?=E6=88=BB=E3=81=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Command/DumpAutoloadCommand.php | 4 +- Command/PluginAlreadyInstalledCommand.php | 4 +- Command/UpdatePreInstallPluginsCommand.php | 4 +- Common/Constant.php | 4 +- Controller/Admin/ConfigController.php | 40 ++++++++++--------- Resource/config/services.yaml | 2 +- Resource/template/admin/check_permission.twig | 4 +- .../template/admin/check_plugin_vesrion.twig | 8 ++-- Resource/template/admin/check_source.twig | 4 +- Resource/template/admin/config.twig | 4 +- Resource/template/admin/update_data.twig | 2 +- bin/replace_version.sh | 2 +- composer.json | 6 +-- 13 files changed, 45 insertions(+), 43 deletions(-) diff --git a/Command/DumpAutoloadCommand.php b/Command/DumpAutoloadCommand.php index 72058a9..984156e 100644 --- a/Command/DumpAutoloadCommand.php +++ b/Command/DumpAutoloadCommand.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace Plugin\EccubeUpdater411to412p1\Command; +namespace Plugin\EccubeUpdater411to412\Command; use Eccube\Service\Composer\ComposerApiService; use Symfony\Component\Console\Command\Command; @@ -22,7 +22,7 @@ class DumpAutoloadCommand extends Command { - protected static $defaultName = 'eccube:update411to412p1:dump-autoload'; + protected static $defaultName = 'eccube:update411to412:dump-autoload'; /** * @var ContainerInterface diff --git a/Command/PluginAlreadyInstalledCommand.php b/Command/PluginAlreadyInstalledCommand.php index 782cd56..9fbd407 100644 --- a/Command/PluginAlreadyInstalledCommand.php +++ b/Command/PluginAlreadyInstalledCommand.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace Plugin\EccubeUpdater411to412p1\Command; +namespace Plugin\EccubeUpdater411to412\Command; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\NoResultException; @@ -28,7 +28,7 @@ class PluginAlreadyInstalledCommand extends Command { - protected static $defaultName = 'eccube:update411to412p1:plugin-already-installed'; + protected static $defaultName = 'eccube:update411to412:plugin-already-installed'; /** * @var ContainerInterface diff --git a/Command/UpdatePreInstallPluginsCommand.php b/Command/UpdatePreInstallPluginsCommand.php index 9e6cf8c..ac51531 100644 --- a/Command/UpdatePreInstallPluginsCommand.php +++ b/Command/UpdatePreInstallPluginsCommand.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace Plugin\EccubeUpdater411to412p1\Command; +namespace Plugin\EccubeUpdater411to412\Command; use Eccube\Repository\BaseInfoRepository; use Eccube\Repository\PluginRepository; @@ -24,7 +24,7 @@ class UpdatePreInstallPluginsCommand extends Command { - protected static $defaultName = 'eccube:update411to412p1:update-pre-install-plugins'; + protected static $defaultName = 'eccube:update411to412:update-pre-install-plugins'; /** * @var ContainerInterface diff --git a/Common/Constant.php b/Common/Constant.php index 86ae0b7..97dd2fa 100644 --- a/Common/Constant.php +++ b/Common/Constant.php @@ -11,11 +11,11 @@ * file that was distributed with this source code. */ -namespace Plugin\EccubeUpdater411to412p1\Common; +namespace Plugin\EccubeUpdater411to412\Common; class Constant { const FROM_VERSION = '4.1.1'; const TO_VERSION = '4.1.2-p1'; - const PLUGIN_CODE = 'EccubeUpdater411to412p1'; + const PLUGIN_CODE = 'EccubeUpdater411to412'; } diff --git a/Controller/Admin/ConfigController.php b/Controller/Admin/ConfigController.php index 6204522..445d53f 100644 --- a/Controller/Admin/ConfigController.php +++ b/Controller/Admin/ConfigController.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace Plugin\EccubeUpdater411to412p1\Controller\Admin; +namespace Plugin\EccubeUpdater411to412\Controller\Admin; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\NoResultException; @@ -25,7 +25,7 @@ use Eccube\Service\PluginApiService; use Eccube\Service\SystemService; use Eccube\Util\CacheUtil; -use Plugin\EccubeUpdater411to412p1\Common\Constant as UpdaterConstant; +use Plugin\EccubeUpdater411to412\Common\Constant as UpdaterConstant; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder; @@ -107,12 +107,14 @@ public function __construct( } /** - * @Route("/%eccube_admin_route%/eccube_updater_411_to_412p1/config", name="eccube_updater411to412p1_admin_config") - * @Template("@EccubeUpdater411to412p1/admin/config.twig") + * @Route("/%eccube_admin_route%/eccube_updater_411_to_412/config", name="eccube_updater411to412_admin_config") + * @Template("@EccubeUpdater411to412/admin/config.twig") */ public function index(Request $request) { - $this->supported = version_compare(Constant::VERSION, UpdaterConstant::FROM_VERSION, '='); + $this->supported = version_compare(Constant::VERSION, UpdaterConstant::FROM_VERSION, '=') || + version_compare(Constant::VERSION, '4.1.2', '='); + ; if (!$this->supported) { $message = sprintf('このプラグインは%s〜%sへのアップデートプラグインです。', UpdaterConstant::FROM_VERSION, UpdaterConstant::TO_VERSION); @@ -156,8 +158,8 @@ public function index(Request $request) /** * プラグインのEC-CUBE対応バージョンのチェックを行う. * - * @Route("/%eccube_admin_route%/eccube_updater_411_to_412p1/check_plugin_version", name="eccube_updater411to412p1_admin_check_plugin_version") - * @Template("@EccubeUpdater411to412p1/admin/check_plugin_vesrion.twig") + * @Route("/%eccube_admin_route%/eccube_updater_411_to_412/check_plugin_version", name="eccube_updater411to412_admin_check_plugin_version") + * @Template("@EccubeUpdater411to412/admin/check_plugin_vesrion.twig") */ public function checkPluginVersion(Request $request) { @@ -185,8 +187,8 @@ public function checkPluginVersion(Request $request) /** * ファイルの書き込み権限チェックを行う. * - * @Route("/%eccube_admin_route%/eccube_updater_411_to_412p1/check_permission", name="eccube_updater411to412p1_admin_check_permission", methods={"POST"}) - * @Template("@EccubeUpdater411to412p1/admin/check_permission.twig") + * @Route("/%eccube_admin_route%/eccube_updater_411_to_412/check_permission", name="eccube_updater411to412_admin_check_permission", methods={"POST"}) + * @Template("@EccubeUpdater411to412/admin/check_permission.twig") */ public function checkPermission(Request $request, Filesystem $fs) { @@ -238,8 +240,8 @@ public function checkPermission(Request $request, Filesystem $fs) /** * 更新ファイルの競合を確認する. * - * @Route("/%eccube_admin_route%/eccube_updater_411_to_412p1/check_source", name="eccube_updater411to412p1_admin_check_source", methods={"POST"}) - * @Template("@EccubeUpdater411to412p1/admin/check_source.twig") + * @Route("/%eccube_admin_route%/eccube_updater_411_to_412/check_source", name="eccube_updater411to412_admin_check_source", methods={"POST"}) + * @Template("@EccubeUpdater411to412/admin/check_source.twig") */ public function checkSource(Request $request) { @@ -295,7 +297,7 @@ public function checkSource(Request $request) /** * ファイルを上書きする. * - * @Route("/%eccube_admin_route%/eccube_updater_411_to_412p1/update_files", name="eccube_updater411to412p1_admin_update_files", methods={"POST"}) + * @Route("/%eccube_admin_route%/eccube_updater_411_to_412/update_files", name="eccube_updater411to412_admin_update_files", methods={"POST"}) */ public function updateFiles(Request $request, CacheUtil $cacheUtil) { @@ -305,7 +307,7 @@ public function updateFiles(Request $request, CacheUtil $cacheUtil) $this->systemService->switchMaintenance(true); $phpPath = $this->getPhpPath(); - $completeUrl = $this->generateUrl('eccube_updater411to412p1_admin_complete', [], UrlGeneratorInterface::ABSOLUTE_URL); + $completeUrl = $this->generateUrl('eccube_updater411to412_admin_complete', [], UrlGeneratorInterface::ABSOLUTE_URL); $this->clearComposerCache(); $this->clearProxies(); @@ -326,13 +328,13 @@ public function updateFiles(Request $request, CacheUtil $cacheUtil) $commands = [ 'cache:clear --no-warmup', 'cache:warmup --no-optional-warmers', - 'eccube:update411to412p1:plugin-already-installed', + 'eccube:update411to412:plugin-already-installed', 'eccube:generate:proxies', 'doctrine:schema:update --dump-sql -f', 'doctrine:migrations:migrate --no-interaction', 'cache:clear --no-warmup', 'cache:warmup --no-optional-warmers', - 'eccube:update411to412p1:dump-autoload', + 'eccube:update411to412:dump-autoload', ]; log_info('Start update commands'); @@ -372,8 +374,8 @@ public function updateFiles(Request $request, CacheUtil $cacheUtil) /** * 完了画面を表示. * - * @Route("/%eccube_admin_route%/eccube_updater_411_to_412p1/complete", name="eccube_updater411to412p1_admin_complete") - * @Template("@EccubeUpdater411to412p1/admin/complete.twig") + * @Route("/%eccube_admin_route%/eccube_updater_411_to_412/complete", name="eccube_updater411to412_admin_complete") + * @Template("@EccubeUpdater411to412/admin/complete.twig") */ public function complete(CacheUtil $cacheUtil) { @@ -460,13 +462,13 @@ private function forceClearCaches() * phpの実行パスを返す * * 実行パスはPhpExecutableFinderで自動探索を行います。 - * PluginDir/Resource/config/services.yamlでeccube_update_plugin_411_412p1_php_pathを定義した場合、こちらが優先されます。 + * PluginDir/Resource/config/services.yamlでeccube_update_plugin_411_412_php_pathを定義した場合、こちらが優先されます。 * * @return false|string */ private function getPhpPath() { - $phpPath = $this->eccubeConfig->get('eccube_update_plugin_411_412p1_php_path'); + $phpPath = $this->eccubeConfig->get('eccube_update_plugin_411_412_php_path'); if ($phpPath && @is_executable($phpPath)) { return $phpPath; } diff --git a/Resource/config/services.yaml b/Resource/config/services.yaml index 8e45815..70ebfa2 100644 --- a/Resource/config/services.yaml +++ b/Resource/config/services.yaml @@ -1,2 +1,2 @@ parameters: - eccube_update_plugin_411_412p1_php_path: ~ + eccube_update_plugin_411_412_php_path: ~ diff --git a/Resource/template/admin/check_permission.twig b/Resource/template/admin/check_permission.twig index 2db5a2e..3afbb77 100644 --- a/Resource/template/admin/check_permission.twig +++ b/Resource/template/admin/check_permission.twig @@ -44,13 +44,13 @@
{% if is_ok %} ファイルの更新確認へ {% else %} 更新 diff --git a/Resource/template/admin/check_plugin_vesrion.twig b/Resource/template/admin/check_plugin_vesrion.twig index b2db2d4..650dcce 100644 --- a/Resource/template/admin/check_plugin_vesrion.twig +++ b/Resource/template/admin/check_plugin_vesrion.twig @@ -17,11 +17,11 @@
{% if is_ok %}
- インストール済のプラグインはEC-CUBE{{ constant('Plugin\\EccubeUpdater411to412p1\\Common\\Constant::TO_VERSION') }}に対応しています + インストール済のプラグインはEC-CUBE{{ constant('Plugin\\EccubeUpdater411to412\\Common\\Constant::TO_VERSION') }}に対応しています
{% else %}
- 以下の{{ unSupportedPlugins|length }}プラグインはEC-CUBE{{ constant('Plugin\\EccubeUpdater411to412p1\\Common\\Constant::TO_VERSION') }}に対応していません。プラグインが動作しない可能性があります。 + 以下の{{ unSupportedPlugins|length }}プラグインはEC-CUBE{{ constant('Plugin\\EccubeUpdater411to412\\Common\\Constant::TO_VERSION') }}に対応していません。プラグインが動作しない可能性があります。
@@ -42,9 +42,9 @@
中止 + href="{{ path('eccube_updater411to412_admin_config') }}">中止 書き込み権限の確認へ diff --git a/Resource/template/admin/check_source.twig b/Resource/template/admin/check_source.twig index 373cea1..b51594b 100644 --- a/Resource/template/admin/check_source.twig +++ b/Resource/template/admin/check_source.twig @@ -63,7 +63,7 @@
中止 + href="{{ path('eccube_updater411to412_admin_config') }}">中止 @@ -87,7 +87,7 @@ 最新バージョンで上書き diff --git a/Resource/template/admin/config.twig b/Resource/template/admin/config.twig index f0eaa76..0dded19 100644 --- a/Resource/template/admin/config.twig +++ b/Resource/template/admin/config.twig @@ -51,7 +51,7 @@
- phpの実行パスを確認してください。
表示されない場合や変更したい場合は、app/Plugin/EccubeUpdater411to412p1/Resource/config/services.yamlで実行パスを設定してください。 + phpの実行パスを確認してください。
表示されない場合や変更したい場合は、app/Plugin/EccubeUpdater411to412/Resource/config/services.yamlで実行パスを設定してください。
@@ -62,7 +62,7 @@
プラグインの対応状況の確認へ diff --git a/Resource/template/admin/update_data.twig b/Resource/template/admin/update_data.twig index 627a294..259654e 100644 --- a/Resource/template/admin/update_data.twig +++ b/Resource/template/admin/update_data.twig @@ -13,7 +13,7 @@
-
+ {{ form_widget(form._token) }}
diff --git a/bin/replace_version.sh b/bin/replace_version.sh index ea1a2ff..e8feac8 100755 --- a/bin/replace_version.sh +++ b/bin/replace_version.sh @@ -8,7 +8,7 @@ PARTIAL_NEXT_VERSION=p1 OVERRIDE_CURRENT_FROM=411 OVERRIDE_CURRENT_TO=412 OVERRIDE_CURRENT_FROM_STR=4.1.1 -OVERRIDE_CURRENT_TO_STR=4.1.2 +OVERRIDE_CURRENT_TO_STR=4.1.2ss NEXT_FROM=$((NEXT_VERSION - 1)) NEXT_TO=$NEXT_VERSION diff --git a/composer.json b/composer.json index 35afdf3..d0df4a3 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { - "name": "ec-cube/eccubeupdater411to412p1", - "version": "1.0.0", + "name": "ec-cube/eccubeupdater411to412", + "version": "1.0.1", "description": "EC-CUBEアップデートプラグイン", "type": "eccube-plugin", "require": { "ec-cube/plugin-installer": "~0.0.6 || ^2.0" }, "extra": { - "code": "EccubeUpdater411to412p1" + "code": "EccubeUpdater411to412" } }