function LocalReadOnlyStream::stream_write

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php \Drupal\Core\StreamWrapper\LocalReadOnlyStream::stream_write()
  2. 10 core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php \Drupal\Core\StreamWrapper\LocalReadOnlyStream::stream_write()
  3. 11.x core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php \Drupal\Core\StreamWrapper\LocalReadOnlyStream::stream_write()

Support for fwrite(), file_put_contents() etc.

Data will not be written as this is a read-only stream wrapper.

Parameters

string $data: The string to be written.

Return value

bool FALSE as data will not be written.

Overrides LocalStream::stream_write

See also

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

File

core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php, line 85

Class

LocalReadOnlyStream
Defines a read-only Drupal stream wrapper base class for local files.

Namespace

Drupal\Core\StreamWrapper

Code

public function stream_write($data) {
    trigger_error('stream_write() not supported for read-only stream wrappers', E_USER_WARNING);
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.