- fixed cache dir (set in config.ini -> API_CACHE`) for "filesystem" based cache backend, closed #763

This commit is contained in:
Mark Friedrich
2019-04-20 13:13:02 +02:00
parent e92e7f74aa
commit 346209da3c

View File

@@ -37,6 +37,9 @@ use Psr\Http\Message\RequestInterface;
*/
abstract class AbstractClient extends \Prefab {
/**
* error msg for missing Composer package
*/
const ERROR_CLIENT_INVALID = "HTTP API client not found → Check installed Composer packages";
/**
@@ -158,11 +161,10 @@ abstract class AbstractClient extends \Prefab {
in_array($poolConfig['type'], ['redis', 'folder']) &&
class_exists(FilesystemCachePool::class)
){
$filesystemAdapter = new Local('./');
$filesystemAdapter = new Local(\Base::instance()->get('ROOT'));
$filesystem = new Filesystem($filesystemAdapter);
$poolFilesystem = new FilesystemCachePool($filesystem, $poolConfig['folder']);
$poolFilesystem = new FilesystemCachePool($filesystem);
$poolFilesystem->setFolder($poolConfig['folder']);
$this->cachePool = $poolFilesystem;
}