function PhpStreamWrapperInterface::stream_set_option
Same name in other branches
- 9 core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php \Drupal\Core\StreamWrapper\PhpStreamWrapperInterface::stream_set_option()
- 8.9.x core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php \Drupal\Core\StreamWrapper\PhpStreamWrapperInterface::stream_set_option()
- 11.x core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php \Drupal\Core\StreamWrapper\PhpStreamWrapperInterface::stream_set_option()
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.
2 methods override PhpStreamWrapperInterface::stream_set_option()
- DummyExternalReadOnlyWrapper::stream_set_option in core/
modules/ file/ tests/ file_test/ src/ StreamWrapper/ DummyExternalReadOnlyWrapper.php - Change stream options.
- LocalStream::stream_set_option in core/
lib/ Drupal/ Core/ StreamWrapper/ LocalStream.php - 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…
File
-
core/
lib/ Drupal/ Core/ StreamWrapper/ PhpStreamWrapperInterface.php, line 407
Class
- PhpStreamWrapperInterface
- Defines a generic PHP stream wrapper interface.
Namespace
Drupal\Core\StreamWrapperCode
public function stream_set_option($option, $arg1, $arg2);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.