Skip to content

Commit b65640b

Browse files
committed
feature: invalidate function
1 parent 13e6e23 commit b65640b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/FileAccess.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,13 @@ public function checkValidity(string $name, int $secondsValidity):void {
3535
throw new CacheInvalidException($filePath);
3636
}
3737
}
38+
39+
public function invalidate(string $name):void {
40+
$filePath = "$this->dirPath/$name";
41+
if(!is_file($filePath)) {
42+
return;
43+
}
44+
45+
unlink($filePath);
46+
}
3847
}

0 commit comments

Comments
 (0)