コード例 #1
0
 public function testClearCaches()
 {
     $this->mockCachePoolIterator();
     $this->cache[0]->expects($this->once())->method('clean');
     $this->cache[1]->expects($this->once())->method('clean');
     $this->object->clearCaches();
 }
コード例 #2
0
ファイル: Status.php プロジェクト: shabbirvividads/magento2
 /**
  * Sets specified modules to enabled or disabled state
  *
  * Performs other necessary routines, such as cache cleanup
  *
  * @param bool $isEnabled
  * @param string[] $modules
  * @return void
  */
 public function setIsEnabled($isEnabled, $modules)
 {
     $result = [];
     foreach ($this->getAllModules($modules) as $name) {
         $currentStatus = $this->list->has($name);
         if (in_array($name, $modules)) {
             $result[$name] = $isEnabled;
         } else {
             $result[$name] = $currentStatus;
         }
     }
     $segment = $this->deploymentConfigFactory->create($result);
     $this->writer->update($segment);
     $this->cleanup->clearCaches();
     $this->cleanup->clearCodeGeneratedFiles();
 }