MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

iStorage

MMO\edms\interfaces · 1 symbole · générée le 27 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
Espace de noms
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

Méthodes7

delete($key)

abstractiStorage.php:30

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

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

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
retourneGeneratorint> key => unix time

localFilename($key)

abstractiStorage.php:38
abstract function localFilename(string $key): ?string
$keystring
retournenull | 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
retournea stream to read the bytes of $key from, the caller closes it
lèveif 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
retournevoid
lèveif $key is not a valid key
lèveif it cannot be stored

size($key)

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