getVarfile("cache.db"); } protected static ?CapacitorStorage $storage = null; protected static function storage(): CapacitorStorage { return self::$storage ??= new SqliteStorage(self::dbfile()); } static function set_storage(CapacitorStorage $storage): CapacitorStorage { return self::$storage = $storage; } static function all(?iterable $rows, $cursorId=null): iterable { CacheChannel::verifix_id($cursorId); $file = "row-{$cursorId["group_id"]}-{$cursorId["id"]}"; $cache = new CacheFile($file, function() use ($rows, $cursorId) { CacheChannel::with(self::storage(), null, $cursorId)->build($rows); return $cursorId; }); return CacheChannel::with(self::storage(), null, $cache->get()); } }