diff --git a/src/mibew/libs/classes/Mibew/Controller/UpdateController.php b/src/mibew/libs/classes/Mibew/Controller/UpdateController.php index 74e6279a..ea8c5eec 100644 --- a/src/mibew/libs/classes/Mibew/Controller/UpdateController.php +++ b/src/mibew/libs/classes/Mibew/Controller/UpdateController.php @@ -94,7 +94,7 @@ class UpdateController extends AbstractController protected function getUpdater() { if (is_null($this->updater)) { - $this->updater = new Updater(); + $this->updater = new Updater($this->getCache()); } return $this->updater; diff --git a/src/mibew/libs/classes/Mibew/Maintenance/Updater.php b/src/mibew/libs/classes/Mibew/Maintenance/Updater.php index 9932d23d..908ff85a 100644 --- a/src/mibew/libs/classes/Mibew/Maintenance/Updater.php +++ b/src/mibew/libs/classes/Mibew/Maintenance/Updater.php @@ -20,6 +20,7 @@ namespace Mibew\Maintenance; use Mibew\Database; +use Stash\Interfaces\PoolInterface; /** * Encapsulates update process. @@ -52,6 +53,23 @@ class Updater */ protected $log = array(); + /** + * An instance of cache pool. + * + * @var PoolInterface|null + */ + protected $cache = null; + + /** + * Class constructor. + * + * @param PoolInterface $cache An instance of cache pool. + */ + public function __construct(PoolInterface $cache) + { + $this->cache = $cache; + } + /** * Retuns list of all errors that took place during update process. * @@ -153,6 +171,9 @@ class Updater return false; } + // Clean up the cache + $this->cache->flush(); + return true; }