3 declare(strict_types=1);
34 return self::PATH_PREFIX;
39 return (
bool) count($this->
getFilesFor($user_id, $type));
47 $finder = $this->storage->finder()
53 foreach ($finder as $file) {
54 $basename = basename($file->getPath());
56 $files[base64_encode($file->getPath())] = $basename;
59 if ($this->storage->hasDir($this->getRelativePath() .
'/' . $user_id)) {
60 $finder = $this->storage->finder()->in([$this->
getRelativePath() .
'/' . $user_id])
64 foreach ($finder as $file) {
65 $basename = basename($file->getPath());
67 $files[base64_encode($file->getPath())] = $basename;
81 $result = preg_match(
'/[0-9]{10}__[0-9]{1,6}__([a-z]{1,4})_[0-9]{2,9}.zip/', $filename, $matches);
85 if (isset($matches[1]) && $matches[1] == $type) {
93 foreach ($this->
getFilesFor($user_id, $type) as $hash => $file) {
94 if (strcmp($hash, $post_hash) === 0) {
95 $file_path = base64_decode($hash);
getAbsolutePathForHash(int $user_id, string $type, string $post_hash)
getFilesFor(int $user_id, string $type)
static getDataDir()
get data directory (outside webspace)
hasFilesFor(int $user_id, string $type)
matchesType(string $type, string $filename)
Check if filename matches a given type.