-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Kharhamel/fix/cache
implemented a cache and a cache clearer in tdbm bundle
- Loading branch information
Showing
7 changed files
with
49 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/Tests export-ignore | ||
/phpstan.neon export-ignore | ||
/phpcs.xml.dist export-ignore | ||
/phpcs.xml export-ignore | ||
/.gitignore export-ignore | ||
/.travis.yml export-ignore |
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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
|
||
namespace TheCodingMachine\TDBM\Bundle\Utils; | ||
|
||
use Doctrine\Common\Cache\FlushableCache; | ||
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface; | ||
|
||
class DoctrineCacheClearer implements CacheClearerInterface | ||
{ | ||
/** | ||
* @var FlushableCache | ||
*/ | ||
private $cache; | ||
|
||
public function __construct(FlushableCache $cache) | ||
{ | ||
$this->cache = $cache; | ||
} | ||
|
||
/** | ||
* Clears any caches necessary. | ||
*/ | ||
public function clear($cacheDir) | ||
{ | ||
$this->cache->flushAll(); | ||
} | ||
} |
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