server
server copied to clipboard
Storage versioning
A more detailed plan after https://github.com/nextcloud/server/issues/9445 and now that https://github.com/nextcloud/server/pull/12129 is in we can look at this in a bit more depth.
I think it is important to make a distinction here. The implementation in https://github.com/nextcloud/server/pull/12129 is to allow version backends. Which is why we have versions in group folders for example.
This is about adding versioning support on a storage level.
I'd propose a new interface to be implemented by storages. IVersionStorage
. This should at least have a method versioningEnabled
(or something similar). Because it might not always be available (e.g. S3 versiniong).
Then this would need the following methods I think
-
getVersions(string $path): IVersion[]
: obtains a list of the current versions -
createVersion(string $path)
: creates a new version (this can also be a void method if that happens automatically on write?) -
restore(IVersion $version): bool
: restores the version
Then IVersion
needs
- size
- time
- id
- mime?
That way we could use it in combination with #12129
@icewind1991 for feedback.