MCPcopy Create free account
hub / github.com/error311/FileRise / deleteShareLink

Method deleteShareLink

src/FileRise/Domain/FileModel.php:3940–3953  ·  view source on GitHub ↗
(string $token)

Source from the content-addressed store, hash-verified

3938 }
3939
3940 public static function deleteShareLink(string $token): bool
3941 {
3942 $shareFile = self::metaRoot() . "share_links.json";
3943 if (!file_exists($shareFile)) {
3944 return false;
3945 }
3946 $links = json_decode(file_get_contents($shareFile), true);
3947 if (!is_array($links) || !isset($links[$token])) {
3948 return false;
3949 }
3950 unset($links[$token]);
3951 file_put_contents($shareFile, json_encode($links, JSON_PRETTY_PRINT), LOCK_EX);
3952 return true;
3953 }
3954
3955 private static function seedFileContents(string $filename): ?string
3956 {

Callers 1

Calls 1

metaRootMethod · 0.95

Tested by

no test coverage detected