Skip to content

Commit

Permalink
Merge pull request #11 from magento-ogre/MAGETWO-54205-cache-disable-…
Browse files Browse the repository at this point in the history
…issue

MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled
  • Loading branch information
Oleksii Korshenko authored Jun 15, 2016
2 parents 29df8c8 + b55ddcb commit a12b957
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/MagentoHackathon/Composer/Magento/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public function onPackageUnistall(\Composer\Installer\PackageEvent $event)
$deployStrategy = $this->installer->getDeployStrategy($package);
$deployStrategy->rmdirRecursive($packageInstallationPath . $ds . $libPath);
$deployStrategy->rmdirRecursive($packageInstallationPath . $ds . $magentoPackagePath);
$this->requestRegeneration();
}

/**
Expand All @@ -155,10 +156,7 @@ public function onNewCodeEvent(\Composer\Script\Event $event)
$this->deployManager->doDeploy();
$this->deployLibraries();
$this->saveVendorDirPath($event->getComposer());
if (file_exists($this->installer->getTargetDir() . $this->varFolder)) {
$filename = $this->installer->getTargetDir() . $this->varFolder . $this->regenerate;
touch($filename);
}
$this->requestRegeneration();
}


Expand Down Expand Up @@ -281,4 +279,17 @@ private function saveVendorDirPath(Composer $composer)
AUTOLOAD;
file_put_contents($vendorPathFile, $content);
}

/**
* Force regeneration of var/di, var/cache, var/generation on next object manager invocation
*
* @return void
*/
private function requestRegeneration()
{
if (is_writable($this->installer->getTargetDir() . $this->varFolder)) {
$filename = $this->installer->getTargetDir() . $this->varFolder . $this->regenerate;
touch($filename);
}
}
}

0 comments on commit a12b957

Please sign in to comment.