You are here

public function DrupalLocalStreamWrapper::stream_set_option in Drupal 7

Change stream options.

This method is called to set options on the stream.

Since Windows systems do not allow it and it is not needed for most use cases anyway, this method is not supported on local files and will trigger an error and return false. If needed, custom subclasses can provide OS-specific implementations for advanced use cases.

Parameters

int $option: One of:

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.

File

includes/stream_wrappers.inc, line 695
Drupal stream wrapper interface.

Class

DrupalLocalStreamWrapper
Drupal stream wrapper base class for local files.

Code

public function stream_set_option($option, $arg1, $arg2) {
  trigger_error('stream_set_option() not supported for local file based stream wrappers', E_USER_WARNING);
  return FALSE;
}