chore: complete update
This commit is contained in:
78
src/Framework/Filesystem/Storage.php
Normal file
78
src/Framework/Filesystem/Storage.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace App\Framework\Filesystem;
|
||||
|
||||
interface Storage
|
||||
{
|
||||
/**
|
||||
* Liest den Inhalt einer Datei
|
||||
*/
|
||||
public function get(string $path): string;
|
||||
|
||||
/**
|
||||
* Speichert Inhalt in einer Datei
|
||||
*/
|
||||
public function put(string $path, string $content): void;
|
||||
|
||||
/**
|
||||
* Prüft, ob eine Datei existiert
|
||||
*/
|
||||
public function exists(string $path): bool;
|
||||
|
||||
/**
|
||||
* Löscht eine Datei
|
||||
*/
|
||||
public function delete(string $path): void;
|
||||
|
||||
/**
|
||||
* Kopiert eine Datei
|
||||
*/
|
||||
public function copy(string $source, string $destination): void;
|
||||
|
||||
/**
|
||||
* Ermittelt die Größe einer Datei in Bytes
|
||||
*/
|
||||
public function size(string $path): int;
|
||||
|
||||
/**
|
||||
* Ermittelt das letzte Änderungsdatum einer Datei
|
||||
*/
|
||||
public function lastModified(string $path): int;
|
||||
|
||||
/**
|
||||
* Ermittelt MIME-Typ einer Datei
|
||||
*/
|
||||
public function getMimeType(string $path): string;
|
||||
|
||||
/**
|
||||
* Prüft, ob eine Datei lesbar ist
|
||||
*/
|
||||
public function isReadable(string $path): bool;
|
||||
|
||||
/**
|
||||
* Prüft, ob eine Datei schreibbar ist
|
||||
*/
|
||||
public function isWritable(string $path): bool;
|
||||
|
||||
/**
|
||||
* Liest ein Verzeichnis aus
|
||||
*
|
||||
* @return array<string> Liste von Dateipfaden
|
||||
*/
|
||||
public function listDirectory(string $directory): array;
|
||||
|
||||
/**
|
||||
* Erstellt ein Verzeichnis
|
||||
*/
|
||||
public function createDirectory(string $path, int $permissions = 0755, bool $recursive = true): void;
|
||||
|
||||
/**
|
||||
* Erstellt ein File-Objekt mit Lazy-Loading
|
||||
*/
|
||||
public function file(string $path): File;
|
||||
|
||||
/**
|
||||
* Erstellt ein Directory-Objekt mit Lazy-Loading
|
||||
*/
|
||||
public function directory(string $path): Directory;
|
||||
}
|
||||
Reference in New Issue
Block a user