mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
fix core manager
This commit is contained in:
@@ -62,7 +62,7 @@ class Manager
|
|||||||
public function hasChange($name, $driver)
|
public function hasChange($name, $driver)
|
||||||
{
|
{
|
||||||
return $this->exists($name) ?
|
return $this->exists($name) ?
|
||||||
$this->registry[$name] === $driver : false;
|
$this->registry[$name] !== $driver : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function save($name, $driver)
|
public function save($name, $driver)
|
||||||
|
@@ -190,15 +190,21 @@ class Core extends \Pimple
|
|||||||
{
|
{
|
||||||
return function($cacheKey, $service)
|
return function($cacheKey, $service)
|
||||||
{
|
{
|
||||||
|
$driverType = $service->getType();
|
||||||
|
$driver = $service->getService();
|
||||||
|
|
||||||
|
if(!file_exists(__DIR__ . '/../../../tmp/cache_registry.yml'))
|
||||||
|
{
|
||||||
|
touch(__DIR__ . '/../../../tmp/cache_registry.yml');
|
||||||
|
}
|
||||||
|
|
||||||
$file = new \SplFileObject(__DIR__ . '/../../../tmp/cache_registry.yml');
|
$file = new \SplFileObject(__DIR__ . '/../../../tmp/cache_registry.yml');
|
||||||
|
|
||||||
$parser = new Core\Configuration\Parser\Yaml();
|
$parser = new Core\Configuration\Parser\Yaml();
|
||||||
|
|
||||||
$cacheManager = new \Alchemy\Phrasea\Cache\Manager($file, $parser);
|
$cacheManager = new \Alchemy\Phrasea\Cache\Manager($file, $parser);
|
||||||
|
|
||||||
$driverType = $service->getType();
|
if ($cacheManager->hasChange($cacheKey, $driverType))
|
||||||
$driver = $service->getService();
|
|
||||||
|
|
||||||
if (!$cacheManager->hasChange($cacheKey, $driverType))
|
|
||||||
{
|
{
|
||||||
$driver->deleteAll();
|
$driver->deleteAll();
|
||||||
$cacheManager->save($cacheKey, $driverType);
|
$cacheManager->save($cacheKey, $driverType);
|
||||||
|
Reference in New Issue
Block a user