added SnapshotManager, added simple function to list snapshots

This commit is contained in:
Jonathan Treffler 2023-06-08 18:23:09 +02:00 committed by root
parent dd565a988e
commit 4c67bf71c4
3 changed files with 18 additions and 2 deletions

View file

@ -12,6 +12,6 @@
<category>files</category>
<bugs>https://git.verdigado.com/verdigado/nextcloud_groupfolder_filesystem_snapshots/issues</bugs>
<dependencies>
<nextcloud min-version="25" max-version="25"/>
<nextcloud min-version="25" max-version="26"/>
</dependencies>
</info>

View file

@ -1,6 +1,6 @@
<?php
namespace OCA\NotesTutorial\AppInfo;
namespace OCA\GroupfolderFilesystemSnapshots\AppInfo;
use OCP\AppFramework\App;

View file

@ -0,0 +1,16 @@
<?php
namespace OCA\GroupfolderFilesystemSnapshots\Manager;
class SnapshotManager {
function get() {
$filesystem_path = "/srv/nextcloud/files/";
$filesystem_snapshot_path = "/srv/nextcloud/files/.zfs/snapshot/";
$iterator = new \FilesystemIterator($filesystem_snapshot_path);
foreach ($iterator as $fileinfo) {
if(!$fileinfo->isDir()) continue;
yield $fileinfo->getFilename();
}
}
}