96 lines
2.1 KiB
PHP
96 lines
2.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Archive\StreamWrapper;
|
|
|
|
/**
|
|
* Interface für benutzerdefinierte Stream-Wrapper
|
|
*/
|
|
interface StreamWrapperInterface
|
|
{
|
|
/**
|
|
* Öffnet einen Stream
|
|
*/
|
|
public function stream_open(string $path, string $mode, int $options, ?string &$opened_path): bool;
|
|
|
|
/**
|
|
* Liest Daten aus dem Stream
|
|
*/
|
|
public function stream_read(int $count): string|false;
|
|
|
|
/**
|
|
* Schreibt Daten in den Stream
|
|
*/
|
|
public function stream_write(string $data): int|false;
|
|
|
|
/**
|
|
* Gibt die aktuelle Position im Stream zurück
|
|
*/
|
|
public function stream_tell(): int|false;
|
|
|
|
/**
|
|
* Prüft, ob das Ende des Streams erreicht ist
|
|
*/
|
|
public function stream_eof(): bool;
|
|
|
|
/**
|
|
* Setzt die Position im Stream
|
|
*/
|
|
public function stream_seek(int $offset, int $whence = SEEK_SET): bool;
|
|
|
|
/**
|
|
* Schließt den Stream
|
|
*/
|
|
public function stream_close(): void;
|
|
|
|
/**
|
|
* Gibt Statistiken über den Stream zurück
|
|
*/
|
|
public function stream_stat(): array|false;
|
|
|
|
/**
|
|
* Gibt Statistiken über eine URL zurück
|
|
*/
|
|
public function url_stat(string $path, int $flags): array|false;
|
|
|
|
/**
|
|
* Erstellt ein Verzeichnis
|
|
*/
|
|
public function mkdir(string $path, int $mode, int $options): bool;
|
|
|
|
/**
|
|
* Entfernt ein Verzeichnis
|
|
*/
|
|
public function rmdir(string $path, int $options): bool;
|
|
|
|
/**
|
|
* Öffnet ein Verzeichnis zum Lesen
|
|
*/
|
|
public function dir_opendir(string $path, int $options): bool;
|
|
|
|
/**
|
|
* Liest den nächsten Eintrag aus einem Verzeichnis
|
|
*/
|
|
public function dir_readdir(): string|false;
|
|
|
|
/**
|
|
* Setzt den Verzeichnis-Handle zurück
|
|
*/
|
|
public function dir_rewinddir(): bool;
|
|
|
|
/**
|
|
* Schließt ein Verzeichnis-Handle
|
|
*/
|
|
public function dir_closedir(): bool;
|
|
|
|
/**
|
|
* Benennt eine Datei um oder verschiebt sie
|
|
*/
|
|
public function rename(string $path_from, string $path_to): bool;
|
|
|
|
/**
|
|
* Löscht eine Datei
|
|
*/
|
|
public function unlink(string $path): bool;
|
|
}
|