Permalink
Browse files

OXDEV-1580 Fix module cache issue

During module activation file cache was not deleted.
  • Loading branch information...
MantasVaitkunas committed Oct 24, 2018
1 parent 4f933a9 commit 63a8bc197199bc87c64ef761d71c19238c6ac7be
@@ -7,8 +7,8 @@
namespace OxidEsales\EshopCommunity\Internal\Module\Command;
use OxidEsales\Eshop\Core\Module\Module;
use OxidEsales\Eshop\Core\Module\ModuleCache;
use OxidEsales\Eshop\Core\Module\ModuleInstaller;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\EshopCommunity\Internal\Adapter\ShopAdapterInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -63,7 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
/** @var Module $module */
if (isset($modules[$moduleId])) {
$this->activateModule($output, $modules[$moduleId]);
$this->activateModule($output, $modules[$moduleId], $moduleId);
} else {
$output->writeLn('<error>'.sprintf(static::MESSAGE_MODULE_NOT_FOUND, $moduleId).'</error>');
}
@@ -75,8 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
*/
protected function activateModule(OutputInterface $output, Module $module)
{
/** @var ModuleInstaller $moduleInstaller */
$moduleInstaller = Registry::get(ModuleInstaller::class);
$moduleInstaller = oxNew(ModuleInstaller::class, oxNew(ModuleCache::class, $module));
if ($module->isActive()) {
$output->writeLn('<info>'.sprintf(static::MESSAGE_MODULE_ALREADY_ACTIVE, $module->getId()).'</info>');
@@ -7,8 +7,8 @@
namespace OxidEsales\EshopCommunity\Internal\Module\Command;
use OxidEsales\Eshop\Core\Module\Module;
use OxidEsales\Eshop\Core\Module\ModuleCache;
use OxidEsales\Eshop\Core\Module\ModuleInstaller;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\EshopCommunity\Internal\Adapter\ShopAdapterInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -63,22 +63,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
$modules = $this->shopAdapter->getModules();
if (isset($modules[$moduleId])) {
$this->deactivateModule($output, $modules, $moduleId);
$this->deactivateModule($output, $modules[$moduleId], $moduleId);
} else {
$output->writeLn('<error>'.sprintf(static::MESSAGE_MODULE_NOT_FOUND, $moduleId).'</error>');
}
}
/**
* @param OutputInterface $output
* @param Module[] $modules
* @param Module $module
* @param string $moduleId
*/
protected function deactivateModule(OutputInterface $output, array $modules, string $moduleId)
protected function deactivateModule(OutputInterface $output, Module $module, string $moduleId)
{
/** @var ModuleInstaller $moduleInstaller */
$moduleInstaller = Registry::get(ModuleInstaller::class);
$module = $modules[$moduleId];
$moduleInstaller = oxNew(ModuleInstaller::class, oxNew(ModuleCache::class, $module));
if ($module->isActive() && $moduleInstaller->deactivate($module)) {
$output->writeLn('<info>' . sprintf(static::MESSAGE_MODULE_DEACTIVATED, $moduleId) . '</info>');
} else {

0 comments on commit 63a8bc1

Please sign in to comment.