From 61efa1d6f351b29d94a1ef96439396a68a27ea74 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Fri, 22 Apr 2016 16:31:38 -0500 Subject: [PATCH 1/6] MAGETWO-50934: setup:upgrade failed during CLI upgrade from CE 2.0.x to 2.1.0 - moving touch to plugin --- src/MagentoHackathon/Composer/Magento/Installer.php | 9 --------- src/MagentoHackathon/Composer/Magento/Plugin.php | 7 +++++++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/MagentoHackathon/Composer/Magento/Installer.php b/src/MagentoHackathon/Composer/Magento/Installer.php index 737e42de..952da34d 100644 --- a/src/MagentoHackathon/Composer/Magento/Installer.php +++ b/src/MagentoHackathon/Composer/Magento/Installer.php @@ -61,11 +61,6 @@ class Installer extends LibraryInstaller implements InstallerInterface */ protected $_deployStrategy = "copy"; - /** - * @var string - */ - private $regeneratePath = '/var/.regenerate'; - const MAGENTO_REMOVE_DEV_FLAG = 'magento-remove-dev'; const MAGENTO_MAINTANANCE_FLAG = 'maintenance.flag'; const MAGENTO_CACHE_PATH = 'var/cache'; @@ -424,8 +419,6 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa if ($this->appendGitIgnore) { $this->appendGitIgnore($package, $this->getGitIgnoreFileLocation()); } - - touch($this->magentoRootDir . $this->regeneratePath); } /** @@ -634,8 +627,6 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini if ($target->getType() === 'magento-core') { $this->postUpdateMagentoCore(); } - - touch($this->magentoRootDir . $this->regeneratePath); } diff --git a/src/MagentoHackathon/Composer/Magento/Plugin.php b/src/MagentoHackathon/Composer/Magento/Plugin.php index fc792839..0c111a62 100644 --- a/src/MagentoHackathon/Composer/Magento/Plugin.php +++ b/src/MagentoHackathon/Composer/Magento/Plugin.php @@ -59,6 +59,11 @@ class Plugin implements PluginInterface, EventSubscriberInterface */ protected $filesystem; + /** + * @var string + */ + private $regenerate = '/var/.regenerate'; + protected function initDeployManager(Composer $composer, IOInterface $io) { $this->deployManager = new DeployManager($io); @@ -144,6 +149,8 @@ public function onNewCodeEvent(\Composer\Script\CommandEvent $event) $this->deployManager->doDeploy(); $this->deployLibraries(); $this->saveVendorDirPath($event->getComposer()); + $filename = $this->installer->getTargetDir() . $this->regenerate; + touch($filename); } From 1bf8b9daa6962169b799520e770931bca491bc6e Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Mon, 23 May 2016 16:10:53 -0500 Subject: [PATCH 2/6] MAGETWO-53352: Create regenerate only if var folder exists - Adding check to see if var directory exists. --- src/MagentoHackathon/Composer/Magento/Plugin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MagentoHackathon/Composer/Magento/Plugin.php b/src/MagentoHackathon/Composer/Magento/Plugin.php index 0c111a62..a4495fc2 100644 --- a/src/MagentoHackathon/Composer/Magento/Plugin.php +++ b/src/MagentoHackathon/Composer/Magento/Plugin.php @@ -149,8 +149,10 @@ public function onNewCodeEvent(\Composer\Script\CommandEvent $event) $this->deployManager->doDeploy(); $this->deployLibraries(); $this->saveVendorDirPath($event->getComposer()); - $filename = $this->installer->getTargetDir() . $this->regenerate; - touch($filename); + if (file_exists($this->installer->getTargetDir() . '/var')) { + $filename = $this->installer->getTargetDir() . $this->regenerate; + touch($filename); + } } From f284621901c579ea03315f580e60212dbc3d7869 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Mon, 23 May 2016 16:25:09 -0500 Subject: [PATCH 3/6] MAGETWO-53352: Create regenerate only if var folder exists - Addressing CR comments. --- src/MagentoHackathon/Composer/Magento/Plugin.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/MagentoHackathon/Composer/Magento/Plugin.php b/src/MagentoHackathon/Composer/Magento/Plugin.php index a4495fc2..cc980919 100644 --- a/src/MagentoHackathon/Composer/Magento/Plugin.php +++ b/src/MagentoHackathon/Composer/Magento/Plugin.php @@ -62,7 +62,12 @@ class Plugin implements PluginInterface, EventSubscriberInterface /** * @var string */ - private $regenerate = '/var/.regenerate'; + private $var = '/var'; + + /** + * @var string + */ + private $regenerate = '/.regenerate'; protected function initDeployManager(Composer $composer, IOInterface $io) { @@ -149,8 +154,8 @@ public function onNewCodeEvent(\Composer\Script\CommandEvent $event) $this->deployManager->doDeploy(); $this->deployLibraries(); $this->saveVendorDirPath($event->getComposer()); - if (file_exists($this->installer->getTargetDir() . '/var')) { - $filename = $this->installer->getTargetDir() . $this->regenerate; + if (file_exists($this->installer->getTargetDir() . $this->var)) { + $filename = $this->installer->getTargetDir() . $this->var . $this->regenerate; touch($filename); } } From 137b68ead97dbbcca29106664293e06fca66e972 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Tue, 24 May 2016 08:43:22 -0500 Subject: [PATCH 4/6] MAGETWO-53352: Create regenerate only if var folder exists - renaming --- src/MagentoHackathon/Composer/Magento/Plugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MagentoHackathon/Composer/Magento/Plugin.php b/src/MagentoHackathon/Composer/Magento/Plugin.php index cc980919..e5910da3 100644 --- a/src/MagentoHackathon/Composer/Magento/Plugin.php +++ b/src/MagentoHackathon/Composer/Magento/Plugin.php @@ -62,7 +62,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface /** * @var string */ - private $var = '/var'; + private $varFolder = '/var'; /** * @var string @@ -154,8 +154,8 @@ public function onNewCodeEvent(\Composer\Script\CommandEvent $event) $this->deployManager->doDeploy(); $this->deployLibraries(); $this->saveVendorDirPath($event->getComposer()); - if (file_exists($this->installer->getTargetDir() . $this->var)) { - $filename = $this->installer->getTargetDir() . $this->var . $this->regenerate; + if (file_exists($this->installer->getTargetDir() . $this->varFolder)) { + $filename = $this->installer->getTargetDir() . $this->varFolder . $this->regenerate; touch($filename); } } From ee6a857ca5e5b289d47b00118fc518523d7d5a36 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Tue, 24 May 2016 09:23:18 -0500 Subject: [PATCH 5/6] MAGETWO-53352: Create regenerate only if var folder exists - Merge commit --- src/MagentoHackathon/Composer/Magento/Plugin.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/MagentoHackathon/Composer/Magento/Plugin.php b/src/MagentoHackathon/Composer/Magento/Plugin.php index 179fde25..0c482517 100644 --- a/src/MagentoHackathon/Composer/Magento/Plugin.php +++ b/src/MagentoHackathon/Composer/Magento/Plugin.php @@ -70,11 +70,6 @@ class Plugin implements PluginInterface, EventSubscriberInterface */ private $varFolder = '/var'; - /** - * @var string - */ - private $regenerate = '/.regenerate'; - protected function initDeployManager(Composer $composer, IOInterface $io) { $this->deployManager = new DeployManager($io); From 0abc82ef26224600aa8093d62f3cfac88bb66d04 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Tue, 24 May 2016 09:30:58 -0500 Subject: [PATCH 6/6] MAGETWO-53352: Create regenerate only if var folder exists - Merge fix --- src/MagentoHackathon/Composer/Magento/Plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MagentoHackathon/Composer/Magento/Plugin.php b/src/MagentoHackathon/Composer/Magento/Plugin.php index 0c482517..93125bb7 100644 --- a/src/MagentoHackathon/Composer/Magento/Plugin.php +++ b/src/MagentoHackathon/Composer/Magento/Plugin.php @@ -63,7 +63,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface /** * @var string */ - private $regenerate = '/var/.regenerate'; + private $regenerate = '/.regenerate'; /** * @var string