mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-04 10:58:31 +03:00
Flush cache on update
This commit is contained in:
parent
07b25a2fc3
commit
d68b0bdb0c
@ -94,7 +94,7 @@ class UpdateController extends AbstractController
|
|||||||
protected function getUpdater()
|
protected function getUpdater()
|
||||||
{
|
{
|
||||||
if (is_null($this->updater)) {
|
if (is_null($this->updater)) {
|
||||||
$this->updater = new Updater();
|
$this->updater = new Updater($this->getCache());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->updater;
|
return $this->updater;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
namespace Mibew\Maintenance;
|
namespace Mibew\Maintenance;
|
||||||
|
|
||||||
use Mibew\Database;
|
use Mibew\Database;
|
||||||
|
use Stash\Interfaces\PoolInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encapsulates update process.
|
* Encapsulates update process.
|
||||||
@ -52,6 +53,23 @@ class Updater
|
|||||||
*/
|
*/
|
||||||
protected $log = array();
|
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.
|
* Retuns list of all errors that took place during update process.
|
||||||
*
|
*
|
||||||
@ -153,6 +171,9 @@ class Updater
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean up the cache
|
||||||
|
$this->cache->flush();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user