Skip to content

Commit

Permalink
replace : asm89/twig-cache-extension
Browse files Browse the repository at this point in the history
resolves notice : Package asm89/twig-cache-extension is abandoned, you should avoid using it. Use twig/cache-extension instead.

fixes : #2347
  • Loading branch information
romainmenke committed Oct 19, 2020
1 parent 88f9e52 commit 9c40b59
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -32,7 +32,7 @@
"twig/twig": "^1.41|^2.10",
"upstatement/routes": "0.5",
"composer/installers": "~1.0",
"asm89/twig-cache-extension": "~1.0"
"twig/cache-extension": "^1.5"
},
"require-dev": {
"johnpbloch/wordpress": "*",
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/performance.md
Expand Up @@ -51,7 +51,7 @@ The following cache modes are available:

## Cache _Parts_ of the Twig File and Data

This method implements the [Twig Cache Extension](https://github.com/asm89/twig-cache-extension). It adds the cache tag, for use in templates. Best shown by example:
This method implements the [Twig Cache Extension](https://github.com/twigphp/twig-cache-extension). It adds the cache tag, for use in templates. Best shown by example:

```twig
{% cache 'index/content' posts %}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cache/KeyGenerator.php
Expand Up @@ -2,7 +2,7 @@

namespace Timber\Cache;

use Asm89\Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface;
use Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface;

class KeyGenerator implements KeyGeneratorInterface {

Expand Down
2 changes: 1 addition & 1 deletion lib/Cache/WPObjectCacheAdapter.php
@@ -1,6 +1,6 @@
<?php namespace Timber\Cache;

use Asm89\Twig\CacheExtension\CacheProviderInterface;
use Twig\CacheExtension\CacheProviderInterface;
use Timber\Loader;

class WPObjectCacheAdapter implements CacheProviderInterface {
Expand Down
6 changes: 3 additions & 3 deletions lib/Loader.php
Expand Up @@ -272,15 +272,15 @@ public static function rrmdir( $dirPath ) {
}

/**
* @return \Asm89\Twig\CacheExtension\Extension
* @return \Twig\CacheExtension\Extension
*/
private function _get_cache_extension() {

$key_generator = new \Timber\Cache\KeyGenerator();
$cache_provider = new \Timber\Cache\WPObjectCacheAdapter($this);
$cache_lifetime = apply_filters('timber/cache/extension/lifetime', 0);
$cache_strategy = new \Asm89\Twig\CacheExtension\CacheStrategy\GenerationalCacheStrategy($cache_provider, $key_generator, $cache_lifetime);
$cache_extension = new \Asm89\Twig\CacheExtension\Extension($cache_strategy);
$cache_strategy = new \Twig\CacheExtension\CacheStrategy\GenerationalCacheStrategy($cache_provider, $key_generator, $cache_lifetime);
$cache_extension = new \Twig\CacheExtension\Extension($cache_strategy);

return $cache_extension;
}
Expand Down

0 comments on commit 9c40b59

Please sign in to comment.