PHP Class VCR\LibraryHooks\StreamWrapperHook

Inheritance: implements VCR\LibraryHooks\LibraryHook
Afficher le fichier Open project: php-vcr/php-vcr Class Usage Examples

Méthodes publiques

Свойство Type Description
$context Current stream context.

Protected Properties

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
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.

Method Details

disable() public méthode

public disable ( )

enable() public méthode

public enable ( Closure $requestCallback )
$requestCallback Closure

isEnabled() public méthode

public isEnabled ( )

stream_eof() public méthode

Tests for end-of-file on a file pointer.
public stream_eof ( ) : boolean
Résultat 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() public méthode

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.
Résultat boolean Returns TRUE on success or FALSE on failure.

stream_open() public méthode

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.
Résultat boolean Returns TRUE on success or FALSE on failure.

stream_read() public méthode

Read from stream.
public stream_read ( integer $count ) : string
$count integer How many bytes of data from the current position should be returned.
Résultat 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() public méthode

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.
Résultat boolean Return TRUE if the position was updated, FALSE otherwise.

stream_stat() public méthode

Retrieve information about a file resource.
public stream_stat ( ) : array
Résultat array See stat().

stream_tell() public méthode

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

stream_write() public méthode

Write to stream.
public stream_write ( string $data ) : integer
$data string Should be stored into the underlying stream.
Résultat integer

url_stat() public méthode

Retrieve information about a file resource.
public url_stat ( $path, $flags ) : array
Résultat array See stat().

Property Details

$context public_oe property

Current stream context.
public $context

$position protected_oe property

Position in the current response body.
protected $position

$requestCallback protected_oe static_oe property

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

$response protected_oe property

protected Response,VCR $response
Résultat VCR\Response

$status protected_oe property

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