This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
104 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,56 @@ | |||
<?php | |||
/** | |||
* Created by PhpStorm. | |||
* User: ghecquet | |||
* Date: 29/06/16 | |||
* Time: 10:07 | |||
*/ | |||
|
|||
namespace Pydio\Cache\Doctrine\Ext; | |||
|
|||
|
|||
use Doctrine\Common\Cache\ChainCache; | |||
|
|||
class PydioChainCache extends ChainCache implements PatternClearableCache { | |||
/** | |||
* @var Redis | |||
*/ | |||
protected $cacheProviders; | |||
|
|||
protected $internalNamespace; | |||
protected $internalNamespaceVersion; | |||
|
|||
|
|||
public function __construct($cacheProviders) | |||
{ | |||
parent::__construct($cacheProviders); | |||
|
|||
$this->cacheProviders = $cacheProviders; | |||
} | |||
|
|||
/** | |||
* @param string $pattern | |||
* @return bool | |||
*/ | |||
public function deleteKeysStartingWith($pattern) { | |||
foreach ($this->cacheProviders as $cache) { | |||
|
|||
if(!($cache instanceof PatternClearableCache)) { | |||
break; | |||
} | |||
|
|||
/** @var PatternClearableCache $cache */ | |||
$pattern = $cache->deleteKeysStartingWith($pattern); | |||
} | |||
} | |||
|
|||
/** | |||
* @param string $namespace | |||
* @return void | |||
*/ | |||
public function setNamespace($namespace) { | |||
foreach ($this->cacheProviders as $cache) { | |||
$cache->setNamespace($namespace); | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters