From 5165dd82e7a2f20fca202fb77646ad914f676e8c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 16 Mar 2021 10:03:05 +0200 Subject: [PATCH] removing vfs-context*.php early 21.1 vfs tests --- vfs-context-links.php | 68 --------------------------------------- vfs-context-share.php | 72 ------------------------------------------ vfs-context-webdav.php | 40 ----------------------- vfs-context.php | 66 -------------------------------------- 4 files changed, 246 deletions(-) delete mode 100644 vfs-context-links.php delete mode 100644 vfs-context-share.php delete mode 100644 vfs-context-webdav.php delete mode 100644 vfs-context.php diff --git a/vfs-context-links.php b/vfs-context-links.php deleted file mode 100644 index 9de82bad60..0000000000 --- a/vfs-context-links.php +++ /dev/null @@ -1,68 +0,0 @@ - [ - 'currentapp' => 'login', - ], -]; -require_once __DIR__.'/header-default.inc.php'; -$_SESSION = []; // reset session, specially cache for links -$egw->session->create($sysop='ralf', '', '', true, false); - -$so = new infolog_so(); -$so->delete(['info_id' => [1, 2]]); -$infolog_sysop = $so->write(['info_id' => 1, 'info_owner' => 5, 'info_subject' => 'Test-InfoLog Ralf', 'info_type' => 'task'], 0, null, true); -// anonymous user give not grants, has not shared groups with Ralf or sysop -$infolog_anon = $so->write(['info_id' => 2, 'info_owner' => ($anon=Api\Accounts::getInstance()->name2id('anonymous')), 'info_subject' => 'Test-InfoLog Anonymous', 'info_type' => 'task'], 0, null, true); -//var_dump($so->read(['info_id' => $infolog_sysop]), $so->read(['info_id' => $infolog_anon])); -// anonymous user needs infolog run rights for further tests -$acl = new Api\Acl($anon); -$acl->add_repository('infolog', 'run', $anon, 1); - -$schema = 'stylite.links'; //'links'; -Vfs::$is_root = true; -Vfs::mount("$schema://default/apps", '/apps', false, false); -Vfs::$is_root = false; -var_dump(Vfs::mount()); - -$infolog_sysop_dir = "/apps/infolog/$infolog_sysop"; -$infolog_anon_dir = "/apps/infolog/$infolog_anon"; -var_dump(file_put_contents("vfs://default$infolog_sysop_dir/test.txt", "Just a test ;)\n")); -var_dump("Vfs::proppatch('$infolog_sysop_dir/test.txt', [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])=" . array2string(Vfs::proppatch("$infolog_sysop_dir/test.txt", [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])), - "Vfs::propfind('$infolog_sysop_dir/test.txt')=" . json_encode(Vfs::propfind("$infolog_sysop_dir/test.txt"), JSON_UNESCAPED_SLASHES)); - -var_dump($f = fopen("vfs://default$infolog_sysop_dir/test.txt", 'r'), fread($f, 100), fclose($f)); - -Vfs::$is_root = true; -var_dump(file_put_contents("vfs://default$infolog_anon_dir/test.txt", "Just a test ;)\n")); -var_dump("Vfs::proppatch('$infolog_anon_dir/test.txt', [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])=" . array2string(Vfs::proppatch("$infolog_anon_dir/test.txt", [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])), - "Vfs::propfind('$infolog_anon_dir/test.txt')=" . json_encode(Vfs::propfind("$infolog_anon_dir/test.txt"), JSON_UNESCAPED_SLASHES)); -var_dump(Vfs::mount(/*"$schema://anonymous@default$infolog_anon_dir"*/"vfs://anonymous@default$infolog_anon_dir", $share_dir = "/home/$sysop/anon-infolog", false, false)); -Vfs::$is_root = false; - -var_dump(Vfs::mount()); - -var_dump("Vfs::resolve_url('$share_dir/test.txt')=" . Vfs::resolve_url("$share_dir/test.txt")); -var_dump("Vfs::url_stat('$share_dir/test.txt')=" . json_encode(Vfs::stat("$share_dir/test.txt"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::is_readable('$share_dir/test.txt')=" . json_encode(Vfs::is_readable("$share_dir/test.txt"))); -var_dump("fopen('vfs://default$share_dir/test.txt', 'r')", $f = fopen("vfs://default$share_dir/test.txt", 'r'), fread($f, 100), fclose($f)); -var_dump("Vfs::propfind('$share_dir/test.txt')", Vfs::propfind("$share_dir/test.txt")); -var_dump("Vfs::proppatch('$share_dir/test.txt', [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something else']])=" . array2string(Vfs::proppatch("$share_dir/test.txt", [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something else']])), - "Vfs::propfind('$share_dir/test.txt')=" . json_encode(Vfs::propfind("$share_dir/test.txt"), JSON_UNESCAPED_SLASHES)); - -var_dump("Vfs::url_stat('$share_dir/test-dir')=" . json_encode(Vfs::stat("$share_dir/test-dir"))); -var_dump("Vfs::mkdir('$share_dir/test-dir')=" . json_encode(Vfs::mkdir("$share_dir/test-dir"))); -var_dump("Vfs::url_stat('$share_dir/test-dir')=" . json_encode(Vfs::stat("$share_dir/test-dir"), JSON_UNESCAPED_SLASHES)); -var_dump(file_put_contents("vfs://default$share_dir/test-dir/test.txt", "Just a test ;)\n")); -var_dump("Vfs::url_stat('$share_dir/test-dir/test.txt')=" . json_encode(Vfs::stat("$share_dir/test-dir"), JSON_UNESCAPED_SLASHES)); -var_dump(file_get_contents("vfs://default$share_dir/test-dir/test.txt")); -var_dump("Vfs::unlink('$share_dir/test-dir/test.txt')=" . json_encode(Vfs::unlink("$share_dir/test-dir/test.txt"))); -var_dump("Vfs::rmdir('$share_dir/test-dir')=" . json_encode(Vfs::rmdir("$share_dir/test-dir"))); -var_dump("Vfs::url_stat('$share_dir/test-dir')=" . json_encode(Vfs::stat("$share_dir/test-dir"))); - -var_dump("Vfs::scandir('$share_dir')=" . json_encode(Vfs::scandir($share_dir), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::remove('$share_dir/test.txt')=" . json_encode(Vfs::remove("$share_dir/test.txt"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::scandir('$share_dir')=" . json_encode(Vfs::scandir($share_dir), JSON_UNESCAPED_SLASHES)); diff --git a/vfs-context-share.php b/vfs-context-share.php deleted file mode 100644 index 46f6f504d5..0000000000 --- a/vfs-context-share.php +++ /dev/null @@ -1,72 +0,0 @@ - [ - 'currentapp' => 'login', - ], -]; -require_once __DIR__.'/header-default.inc.php'; - -$GLOBALS['egw_info']['user'] = [ - 'account_id' => 5, - 'account_lid' => $sysop='ralf', -]; - -$other = 'birgit'; - -$schema = 'sqlfs';//'stylite.versioning'; //'sqlfs'; -Vfs::$is_root = true; -Vfs::mount("$schema://default/home", '/home', false, false); -Vfs::$is_root = false; -var_dump(Vfs::mount()); -//var_dump(Vfs::scandir('/home')); -//var_dump(Vfs::find('/home', ['maxdepth' => 1])); -//var_dump(Vfs::scandir("/home/$sysop")); - -var_dump(file_put_contents("vfs://default/home/$sysop/test.txt", "Just a test ;)\n")); -var_dump("Vfs::proppatch('/home/$sysop/test.txt', [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])=".array2string(Vfs::proppatch("/home/$sysop/test.txt", [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])), - "Vfs::propfind('/home/$sysop/test.txt')=".json_encode(Vfs::propfind("/home/$sysop/test.txt"), JSON_UNESCAPED_SLASHES)); - -var_dump($f=fopen("vfs://default/home/$sysop/test.txt", 'r'), fread($f, 100), fclose($f)); -//var_dump(Vfs::find("/home/$sysop", ['maxdepth' => 1])); - -Vfs::$is_root = true; -var_dump(file_put_contents("vfs://default/home/$other/test.txt", "Just a test ;)\n")); -var_dump("Vfs::proppatch('/home/$other/test.txt', [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])=".array2string(Vfs::proppatch("/home/$other/test.txt", [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])), - "Vfs::propfind('/home/$other/test.txt')=".json_encode(Vfs::propfind("/home/$other/test.txt"), JSON_UNESCAPED_SLASHES)); -$backup = Vfs::$user; Vfs::$user = Api\Accounts::getInstance()->name2id($other); -$share = stylite_sharing::create("/home/$other", stylite_sharing::WRITABLE, '', $sysop); -Vfs::$user = $backup; -var_dump($share); -var_dump(Vfs::mount($sharing_url="sharing://$share[share_token]@default/", "/home/$sysop/$other", false, false)); -Vfs::$is_root = false; - -var_dump(Vfs::mount()); - -var_dump(Vfs::load_wrapper('sharing')); -var_dump(stat($sharing_url.'test.txt')); -var_dump(file_get_contents($sharing_url.'test.txt')); - -var_dump("Vfs::resolve_url('/home/$sysop/$other/test.txt')=".Vfs::resolve_url("/home/$sysop/$other/test.txt")); -var_dump("Vfs::stat('/home/$sysop/$other/test.txt')=".json_encode(Vfs::stat("/home/$sysop/$other/test.txt"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::is_readable('/home/$sysop/$other/test.txt')=".json_encode(Vfs::is_readable("/home/$sysop/$other/test.txt"))); -var_dump("fopen('vfs://default/home/$sysop/$other/test.txt', 'r')", $f=fopen("vfs://default/home/$sysop/$other/test.txt", 'r'), fread($f, 100), fclose($f)); - -var_dump("Vfs::propfind('/home/$sysop/$other/test.txt')", Vfs::propfind("/home/$sysop/$other/test.txt")); -var_dump("Vfs::proppatch('/home/$sysop/$other/test.txt', [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something else']])=".array2string(Vfs::proppatch("/home/$sysop/$other/test.txt", [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something else']])), - "Vfs::propfind('/home/$sysop/$other/test.txt')=".json_encode(Vfs::propfind("/home/$sysop/$other/test.txt"), JSON_UNESCAPED_SLASHES)); - -var_dump("Vfs::url_stat('/home/$sysop/$other/test-dir')=".json_encode(Vfs::stat("/home/$sysop/$other/test-dir"))); -var_dump("Vfs::mkdir('/home/$sysop/$other/test-dir')=".json_encode(Vfs::mkdir("/home/$sysop/$other/test-dir"))); -var_dump("Vfs::scandir('/home/$sysop/$other')=".json_encode(Vfs::scandir("/home/$sysop/$other"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::stat('/home/$sysop/$other/test-dir')=".json_encode(Vfs::stat("/home/$sysop/$other/test-dir"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::rmdir('/home/$sysop/$other/test-dir')=".json_encode(Vfs::rmdir("/home/$sysop/$other/test-dir"))); -var_dump("Vfs::stat('/home/$sysop/$other/test-dir')=".json_encode(Vfs::stat("/home/$sysop/$other/test-dir"))); -var_dump("Vfs::remove('/home/$sysop/$other/test.txt')=".json_encode(Vfs::remove("/home/$sysop/$other/test.txt"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::stat('/home/$sysop/$other/test.txt')=".json_encode(Vfs::stat("/home/$sysop/$other/test.txt"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::scandir('/home/$sysop/$other')=".json_encode(Vfs::scandir("/home/$sysop/$other"), JSON_UNESCAPED_SLASHES)); - -stylite_sharing::delete($share['share_id']); \ No newline at end of file diff --git a/vfs-context-webdav.php b/vfs-context-webdav.php deleted file mode 100644 index ecdec9a7e7..0000000000 --- a/vfs-context-webdav.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - 'currentapp' => 'login', - ], -]; -require_once __DIR__.'/header-default.inc.php'; - -$GLOBALS['egw_info']['user'] = [ - 'account_id' => 5, - 'account_lid' => $sysop='ralf', -]; - -$other = 'birgit'; - -WebDav\StreamWrapper::register(); - -var_dump(file_put_contents("vfs://default/home/$sysop/test.txt", "Just a test ;)\n")); - -$base = "webdavs://$sysop:secret@boulder.egroupware.org/egroupware/webdav.php"; -var_dump(scandir("$base/home")); - -Vfs::$is_root = true; -Vfs::mount("$base/home/$sysop", "/home/$sysop/webdav", false, false); -Vfs::$is_root = false; -var_dump(Vfs::mount()); -var_dump(Vfs::scandir("/home/$sysop/webdav")); -var_dump(file_get_contents("vfs://default/home/$sysop/webdav/test.txt")); -var_dump(Vfs::find("/home/$sysop/webdav", ['maxdepth' => 1], true)); -//var_dump(Vfs::scandir("/home/$sysop")); - -var_dump(scandir($share = "webdavs://pole.egroupware.org/egroupware/share.php/c2nqd6plwiTT8ha6U22sZXsLc7vkVdM3")); -Vfs::$is_root = true; -Vfs::mount("$share", "/home/$sysop/shares/PressRelease-20.1", false, false); -Vfs::$is_root = false; -var_dump(Vfs::find("/home/$sysop/shares/PressRelease-20.1", ['maxdepth' => 1], true)); diff --git a/vfs-context.php b/vfs-context.php deleted file mode 100644 index 7cc52e8a76..0000000000 --- a/vfs-context.php +++ /dev/null @@ -1,66 +0,0 @@ - [ - 'currentapp' => 'login', - ], -]; -require_once __DIR__.'/header-default.inc.php'; - -$GLOBALS['egw_info']['user'] = [ - 'account_id' => 5, - 'account_lid' => $sysop='ralf', -]; - -$other = 'birgit'; - -$schema = 'stylite.versioning'; //'sqlfs'; -Vfs::$is_root = true; -Vfs::mount("$schema://default/home", '/home', false, false); -Vfs::$is_root = false; -var_dump(Vfs::mount()); -var_dump(Vfs::scandir('/home')); -var_dump(Vfs::find('/home', ['maxdepth' => 1])); -//var_dump(Vfs::scandir("/home/$sysop")); - -Vfs::$is_root = true; -Vfs::mount('filesystem://default/var/lib/egroupware', "/home/$other/something", false, false); -Vfs::$is_root = false; -var_dump(Vfs::stat("/home/$other/something")); - -var_dump(file_put_contents("vfs://default/home/$sysop/test.txt", "Just a test ;)\n")); -var_dump("Vfs::proppatch('/home/$sysop/test.txt', [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])=".array2string(Vfs::proppatch("/home/$sysop/test.txt", [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])), - "Vfs::propfind('/home/$sysop/test.txt')=".json_encode(Vfs::propfind("/home/$sysop/test.txt"), JSON_UNESCAPED_SLASHES)); - -var_dump($f=fopen("vfs://default/home/$sysop/test.txt", 'r'), fread($f, 100), fclose($f)); -//var_dump(Vfs::find("/home/$sysop", ['maxdepth' => 1])); - -Vfs::$is_root = true; -var_dump(file_put_contents("vfs://default/home/$other/test.txt", "Just a test ;)\n")); -var_dump("Vfs::proppatch('/home/$other/test.txt', [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])=".array2string(Vfs::proppatch("/home/$other/test.txt", [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something']])), - "Vfs::propfind('/home/$other/test.txt')=".json_encode(Vfs::propfind("/home/$other/test.txt"), JSON_UNESCAPED_SLASHES)); -var_dump(Vfs::mount("vfs://$other@default/home/$other", "/home/$sysop/$other", false, false)); -Vfs::$is_root = false; - -var_dump(Vfs::mount()); - -var_dump("Vfs::resolve_url('/home/$sysop/$other/test.txt')=".Vfs::resolve_url("/home/$sysop/$other/test.txt")); -var_dump("Vfs::url_stat('/home/$sysop/$other/test.txt')=".json_encode(Vfs::stat("/home/$sysop/$other/test.txt"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::is_readable('/home/$sysop/$other/test.txt')=".json_encode(Vfs::is_readable("/home/$sysop/$other/test.txt"))); -var_dump("fopen('vfs://default/home/$sysop/$other/test.txt', 'r')", $f=fopen("vfs://default/home/$sysop/$other/test.txt", 'r'), fread($f, 100), fclose($f)); -var_dump("Vfs::propfind('/home/$sysop/$other/test.txt')", Vfs::propfind("/home/$sysop/$other/test.txt")); -var_dump("Vfs::proppatch('/home/$sysop/$other/test.txt', [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something else']])=".array2string(Vfs::proppatch("/home/$sysop/$other/test.txt", [['ns' => Vfs::DEFAULT_PROP_NAMESPACE, 'name' => 'test', 'val' => 'something else']])), - "Vfs::propfind('/home/$sysop/$other/test.txt')=".json_encode(Vfs::propfind("/home/$sysop/$other/test.txt"), JSON_UNESCAPED_SLASHES)); - - -var_dump("Vfs::url_stat('/home/$sysop/$other/test-dir')=".json_encode(Vfs::stat("/home/$sysop/$other/test-dir"))); -var_dump("Vfs::mkdir('/home/$sysop/$other/test-dir')=".json_encode(Vfs::mkdir("/home/$sysop/$other/test-dir"))); -var_dump("Vfs::url_stat('/home/$sysop/$other/test-dir')=".json_encode(Vfs::stat("/home/$sysop/$other/test-dir"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::rmdir('/home/$sysop/$other/test-dir')=".json_encode(Vfs::rmdir("/home/$sysop/$other/test-dir"))); -var_dump("Vfs::url_stat('/home/$sysop/$other/test-dir')=".json_encode(Vfs::stat("/home/$sysop/$other/test-dir"))); - -var_dump("Vfs::scandir('/home/$sysop/$other')=".json_encode(Vfs::scandir("/home/$sysop/$other"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::remove('/home/$sysop/$other/test.txt')=".json_encode(Vfs::remove("/home/$sysop/$other/test.txt"), JSON_UNESCAPED_SLASHES)); -var_dump("Vfs::scandir('/home/$sysop/$other')=".json_encode(Vfs::scandir("/home/$sysop/$other"), JSON_UNESCAPED_SLASHES));