Index

iStorage

MMO\edms\interfaces · 1 symbol · generated 5 Oct 2026

interface

iStorage

iStorage.php:12

Where the bytes of the files are kept, by key: a file only knows its key (File::$storageKey), never where the storage puts it. LocalStorage keeps them in a folder; another storage (S3...) implements the same methods.

interface MMO\edms\interfaces\iStorage
Namespace
MMO\edms\interfaces
A key is made of letters, digits, `.`, `_`, `-` and `/`, never starts with one of them nor holds a `..`.

Index

delete($key) abstractForget the bytes of $key: nothing happens if there are none
exists($key) abstract
keys() abstractEvery key kept, and when its bytes were written: what the garbage collector compares with the files.
localFilename($key) abstract
open($key) abstract
put($key, $filename) abstractKeep the local file $filename under $key: the file is moved, it is the storage's afterwards.
size($key) abstract

Methods7

delete($key)

abstractiStorage.php:30

Forget the bytes of $key: nothing happens if there are none

abstract function delete(string $key): void
$keystring
returnsvoid

keys()

abstractiStorage.php:44

Every key kept, and when its bytes were written: what the garbage collector compares with the files.

abstract function keys(): Generator
returnsGeneratorint> key => unix time

localFilename($key)

abstractiStorage.php:38
abstract function localFilename(string $key): ?string
$keystring
returnsnull | stringa local file holding the bytes of $key, when the storage has one: they are read from it without a copy

open($key)

abstractiStorage.php:27
abstract function open(string $key)
$keystring
returnsa stream to read the bytes of $key from, the caller closes it
throwsif nothing is kept under $key

put($key, $filename)

abstractiStorage.php:21

Keep the local file $filename under $key: the file is moved, it is the storage's afterwards.

abstract function put(string $key, string $filename): void
$keystring
$filenamestring
returnsvoid
throwsif $key is not a valid key
throwsif it cannot be stored

size($key)

abstractiStorage.php:35
abstract function size(string $key): ?int
$keystring
returnsnull | intthe size of the bytes of $key, null if there are none