Nextcloud version 11
Operating system and version Ubuntu 16.04
PHP version 7.1
did you ever find out how to?
ok. if somebody else ever has the same question:
assuming that you use redis for file locking, you can get it like that:
class test {
public function __construct(ICacheFactory $cacheFactory) {
$this->redis = $cacheFactory->createLocking ( "oc_midwife_" );
}
}
Otherwise something like that should work (untested). the redis server needs to be defined in the config
class test {
public function __construct(RedisFactory $factory) {
$this->redis = $factory->create();
}
}