PHP 클래스 VCR\LibraryHooks\StreamWrapperHook

상속: implements VCR\LibraryHooks\LibraryHook
파일 보기 프로젝트 열기: php-vcr/php-vcr 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$context Current stream context.

보호된 프로퍼티들

프로퍼티 타입 설명
$position Position in the current response body.
$requestCallback Callback which will be executed when a request is intercepted.
$response VCR\Response
$status Current status of this hook, either enabled or disabled.

공개 메소드들

메소드 설명
disable ( )
enable ( Closure $requestCallback )
isEnabled ( )
stream_eof ( ) : boolean Tests for end-of-file on a file pointer.
stream_metadata ( string $path, integer $option, mixed $var ) : boolean Change stream options.
stream_open ( string $path, string $mode, integer $options, string &$opened_path ) : boolean This method is called immediately after the wrapper is initialized (f.e. by fopen() and file_get_contents()).
stream_read ( integer $count ) : string Read from stream.
stream_seek ( integer $offset, integer $whence ) : boolean Seeks to specific location in a stream.
stream_stat ( ) : array Retrieve information about a file resource.
stream_tell ( ) : integer Retrieve the current position of a stream.
stream_write ( string $data ) : integer Write to stream.
url_stat ( $path, $flags ) : array Retrieve information about a file resource.

메소드 상세

disable() 공개 메소드

public disable ( )

enable() 공개 메소드

public enable ( Closure $requestCallback )
$requestCallback Closure

isEnabled() 공개 메소드

public isEnabled ( )

stream_eof() 공개 메소드

Tests for end-of-file on a file pointer.
public stream_eof ( ) : boolean
리턴 boolean Should return TRUE if the read/write position is at the end of the stream and if no more data is available to be read, or FALSE otherwise.

stream_metadata() 공개 메소드

Change stream options.
public stream_metadata ( string $path, integer $option, mixed $var ) : boolean
$path string The file path or URL to set metadata.
$option integer One of the stream options.
$var mixed Value depending on the option.
리턴 boolean Returns TRUE on success or FALSE on failure.

stream_open() 공개 메소드

This method is called immediately after the wrapper is initialized (f.e. by fopen() and file_get_contents()).
public stream_open ( string $path, string $mode, integer $options, string &$opened_path ) : boolean
$path string Specifies the URL that was passed to the original function.
$mode string The mode used to open the file, as detailed for fopen().
$options integer Holds additional flags set by the streams API.
$opened_path string If the path is opened successfully, and STREAM_USE_PATH is set.
리턴 boolean Returns TRUE on success or FALSE on failure.

stream_read() 공개 메소드

Read from stream.
public stream_read ( integer $count ) : string
$count integer How many bytes of data from the current position should be returned.
리턴 string If there are less than count bytes available, return as many as are available. If no more data is available, return either FALSE or an empty string.

stream_seek() 공개 메소드

Seeks to specific location in a stream.
public stream_seek ( integer $offset, integer $whence ) : boolean
$offset integer The stream offset to seek to.
$whence integer Possible values: SEEK_SET - Set position equal to offset bytes. SEEK_CUR - Set position to current location plus offset. SEEK_END - Set position to end-of-file plus offset.
리턴 boolean Return TRUE if the position was updated, FALSE otherwise.

stream_stat() 공개 메소드

Retrieve information about a file resource.
public stream_stat ( ) : array
리턴 array See stat().

stream_tell() 공개 메소드

This method is called in response to fseek() to determine the current position.
public stream_tell ( ) : integer
리턴 integer Should return the current position of the stream.

stream_write() 공개 메소드

Write to stream.
public stream_write ( string $data ) : integer
$data string Should be stored into the underlying stream.
리턴 integer

url_stat() 공개 메소드

Retrieve information about a file resource.
public url_stat ( $path, $flags ) : array
리턴 array See stat().

프로퍼티 상세

$context 공개적으로 프로퍼티

Current stream context.
public $context

$position 보호되어 있는 프로퍼티

Position in the current response body.
protected $position

$requestCallback 보호되어 있는 정적으로 프로퍼티

Callback which will be executed when a request is intercepted.
protected static $requestCallback

$response 보호되어 있는 프로퍼티

protected Response,VCR $response
리턴 VCR\Response

$status 보호되어 있는 프로퍼티

Current status of this hook, either enabled or disabled.
protected $status