interface PhpStreamWrapperInterface (View source)

Defines a generic PHP stream wrapper interface.

Methods

bool
dir_closedir()

No description

bool
dir_opendir($path, $options)

No description

string
dir_readdir()

No description

bool
dir_rewinddir()

No description

bool
mkdir($path, $mode, $options)

No description

bool
rename($path_from, $path_to)

No description

bool
rmdir($path, $options)

No description

resource|false
stream_cast(int $cast_as)

Retrieve the underlying stream resource.

stream_close()

Closes stream.

bool
stream_eof()

No description

bool
stream_flush()

No description

bool
stream_lock($operation)

No description

bool
stream_metadata(string $path, int $option, mixed $value)

Sets metadata on the stream.

bool
stream_open($path, $mode, $options, $opened_path)

No description

string
stream_read($count)

No description

bool
stream_seek(int $offset, int $whence = SEEK_SET)

Seeks to specific location in a stream.

bool
stream_set_option(int $option, int $arg1, int $arg2)

Change stream options.

array
stream_stat()

No description

int
stream_tell()

No description

bool
stream_truncate(int $new_size)

Truncate stream.

int
stream_write($data)

No description

bool
unlink($path)

No description

array
url_stat($path, $flags)

No description

Details

bool dir_closedir()

No description

Return Value

bool

bool dir_opendir($path, $options)

No description

Parameters

$path
$options

Return Value

bool

string dir_readdir()

No description

Return Value

string

bool dir_rewinddir()

No description

Return Value

bool

bool mkdir($path, $mode, $options)

No description

Parameters

$path
$mode
$options

Return Value

bool

bool rename($path_from, $path_to)

No description

Parameters

$path_from
$path_to

Return Value

bool

bool rmdir($path, $options)

No description

Parameters

$path
$options

Return Value

bool

resource|false stream_cast(int $cast_as)

Retrieve the underlying stream resource.

This method is called in response to stream_select().

Parameters

int $cast_as

Can be STREAM_CAST_FOR_SELECT when stream_select() is calling stream_cast() or STREAM_CAST_AS_STREAM when stream_cast() is called for other uses.

Return Value

resource|false

The underlying stream resource or FALSE if stream_select() is not supported.

See also

stream_select()
http://php.net/manual/streamwrapper.stream-cast.php

stream_close()

Closes stream.

bool stream_eof()

No description

Return Value

bool

bool stream_flush()

No description

Return Value

bool

bool stream_lock($operation)

No description

Parameters

$operation

Return Value

bool

bool stream_metadata(string $path, int $option, mixed $value)

Sets metadata on the stream.

Parameters

string $path

A string containing the URI to the file to set metadata on.

int $option

One of:

  • STREAM_META_TOUCH: The method was called in response to touch().
  • STREAM_META_OWNER_NAME: The method was called in response to chown() with string parameter.
  • STREAM_META_OWNER: The method was called in response to chown().
  • STREAM_META_GROUP_NAME: The method was called in response to chgrp().
  • STREAM_META_GROUP: The method was called in response to chgrp().
  • STREAM_META_ACCESS: The method was called in response to chmod().
mixed $value

If option is:

  • STREAM_META_TOUCH: Array consisting of two arguments of the touch() function.
  • STREAM_META_OWNER_NAME or STREAM_META_GROUP_NAME: The name of the owner user/group as string.
  • STREAM_META_OWNER or STREAM_META_GROUP: The value of the owner user/group as integer.
  • STREAM_META_ACCESS: The argument of the chmod() as integer.

Return Value

bool

Returns TRUE on success or FALSE on failure. If $option is not implemented, FALSE should be returned.

See also

http://php.net/manual/streamwrapper.stream-metadata.php

bool stream_open($path, $mode, $options, $opened_path)

No description

Parameters

$path
$mode
$options
$opened_path

Return Value

bool

string stream_read($count)

No description

Parameters

$count

Return Value

string

bool stream_seek(int $offset, int $whence = SEEK_SET)

Seeks to specific location in a stream.

This method is called in response to fseek().

The read/write position of the stream should be updated according to the offset and whence.

Parameters

int $offset

The byte offset to seek to.

int $whence

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. Defaults to SEEK_SET.

Return Value

bool

TRUE if the position was updated, FALSE otherwise.

See also

http://php.net/manual/streamwrapper.stream-seek.php

bool stream_set_option(int $option, int $arg1, int $arg2)

Change stream options.

This method is called to set options on the stream.

Parameters

int $option

One of:

  • STREAM_OPTION_BLOCKING: The method was called in response to stream_set_blocking().
  • STREAM_OPTION_READ_TIMEOUT: The method was called in response to stream_set_timeout().
  • STREAM_OPTION_WRITE_BUFFER: The method was called in response to stream_set_write_buffer().
int $arg1

If option is:

  • STREAM_OPTION_BLOCKING: The requested blocking mode:
    • 1 means blocking.
    • 0 means not blocking.
  • STREAM_OPTION_READ_TIMEOUT: The timeout in seconds.
  • STREAM_OPTION_WRITE_BUFFER: The buffer mode, STREAM_BUFFER_NONE or STREAM_BUFFER_FULL.
int $arg2

If option is:

  • STREAM_OPTION_BLOCKING: This option is not set.
  • STREAM_OPTION_READ_TIMEOUT: The timeout in microseconds.
  • STREAM_OPTION_WRITE_BUFFER: The requested buffer size.

Return Value

bool

TRUE on success, FALSE otherwise. If $option is not implemented, FALSE should be returned.

array stream_stat()

No description

Return Value

array

int stream_tell()

No description

Return Value

int

bool stream_truncate(int $new_size)

Truncate stream.

Will respond to truncation; e.g., through ftruncate().

Parameters

int $new_size

The new size.

Return Value

bool

TRUE on success, FALSE otherwise.

int stream_write($data)

No description

Parameters

$data

Return Value

int

No description

Parameters

$path

Return Value

bool

array url_stat($path, $flags)

No description

Parameters

$path
$flags

Return Value

array