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가 실제 컨텍스트 리소스로 채울 수 있도록 공개되어야 합니다.
기타
목차
- streamWrapper::__construct — 새로운 스트림 래퍼를 생성합니다.
- streamWrapper::__destruct — 기존 스트림 래퍼를 파괴합니다.
- streamWrapper::dir_closedir — 디렉토리 핸들 닫기
- streamWrapper::dir_opendir — 디렉토리 핸들 열기
- streamWrapper::dir_readdir — 디렉토리 핸들에서 항목 읽기
- streamWrapper::dir_rewinddir — 디렉토리 핸들 되감기
- streamWrapper::mkdir — 디렉토리 생성
- streamWrapper::rename — 파일 또는 디렉토리의 이름을 바꿉니다.
- streamWrapper::rmdir — 디렉토리를 제거합니다
- streamWrapper::stream_cast — 기본 리소스 검색
- streamWrapper::stream_close — 리소스 닫기
- streamWrapper::stream_eof — 파일 포인터에서 파일 끝 테스트
- streamWrapper::stream_flush — 출력을 플러시합니다.
- streamWrapper::stream_lock — 파일 잠금 권고
- streamWrapper::stream_metadata — 스트림 메타데이터 변경
- streamWrapper::stream_open — 파일 또는 URL을 엽니다.
- streamWrapper::stream_read — 스트림에서 읽기
- streamWrapper::stream_seek — 스트림의 특정 위치를 찾습니다.
- streamWrapper::stream_set_option — 스트림 옵션 변경
- streamWrapper::stream_stat — 파일 리소스에 대한 정보 검색
- streamWrapper::stream_tell — 스트림의 현재 위치 검색
- streamWrapper::stream_truncate — 스트림 자르기
- streamWrapper::stream_write — 스트림에 쓰기
- streamWrapper::unlink — 파일 삭제
- streamWrapper::url_stat — 파일에 대한 정보 검색