Streams The streamWrapper class

(PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8)


소개

다른 모든 파일 시스템 함수(예: fopen(), fread() 등)과 함께 사용하기 위해 고유한 프로토콜 핸들러 및 스트림을 구현할 수 있습니다.

메모: 이것은 실제 클래스가 아니며 자체 프로토콜을 정의하는 클래스의 프로토타입일 뿐입니다.

메모: 여기에 설명된 것과 다른 방식으로 메서드를 구현하면 정의되지 않은 동작이 발생할 수 있습니다.

이 클래스의 인스턴스는 스트림 함수가 연결된 프로토콜에 액세스하려고 하자마자 초기화됩니다.


클래스 개요

                  
class streamWrapper {

  /* Properties */
  public resource $context;

  /* Methods */
  public __construct()
  public dir_closedir(): bool
  public dir_opendir(string $path, int $options): bool
  public dir_readdir(): string
  public dir_rewinddir(): bool
  public mkdir(string $path, int $mode, int $options): bool
  public rename(string $path_from, string $path_to): bool
  public rmdir(string $path, int $options): bool
  public stream_cast(int $cast_as): resource
  public stream_close(): void
  public stream_eof(): bool
  public stream_flush(): bool
  public stream_lock(int $operation): bool
  public stream_metadata(string $path, int $option, mixed $value): bool
  public stream_open(
      string $path,
      string $mode,
      int $options,
      ?string &$opened_path
  ): bool
  public stream_read(int $count): string|false
  public stream_seek(int $offset, int $whence = SEEK_SET): bool
  public stream_set_option(int $option, int $arg1, int $arg2): bool
  public stream_stat(): array|false
  public stream_tell(): int
  public stream_truncate(int $new_size): bool
  public stream_write(string $data): int
  public unlink(string $path): bool
  public url_stat(string $path, int $flags): array|false
  public __destruct()
}
                  
                

Properties

resource context
현재 컨텍스트 또는 호출자 함수에 컨텍스트가 전달되지 않은 경우 null입니다.

stream_context_get_options()를 사용하여 컨텍스트를 구문 분석합니다.

메모: 이 속성은 PHP가 실제 컨텍스트 리소스로 채울 수 있도록 공개되어야 합니다.


기타


목차