Skip to content

Commit dd5cdf0

Browse files
committed
Added Filesystem cacheKey and cacheDuration properties for caching feature
1 parent b5cbdbb commit dd5cdf0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Filesystem.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ abstract class Filesystem extends Component
6464
* @var string|null
6565
*/
6666
public $cache;
67+
/**
68+
* @var string
69+
*/
70+
public $cacheKey = 'flysystem';
71+
/**
72+
* @var integer
73+
*/
74+
public $cacheDuration = 3600;
6775
/**
6876
* @var string|null
6977
*/
@@ -101,7 +109,7 @@ protected function decorateAdapter(AdapterInterface $adapter)
101109
throw new InvalidConfigException('The "cache" property must be an instance of \yii\caching\Cache subclasses.');
102110
}
103111

104-
$adapter = new CachedAdapter($adapter, new YiiCache($cache));
112+
$adapter = new CachedAdapter($adapter, new YiiCache($cache, $this->cacheKey, $this->cacheDuration));
105113
}
106114

107115
if ($this->replica !== null) {

0 commit comments

Comments
 (0)