PHP Класс VCR\LibraryHooks\StreamWrapperHook

Наследование: implements VCR\LibraryHooks\LibraryHook
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$context Current stream context.

Защищенные свойства (Protected)

Свойство Тип Описание
$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