Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. vfsStreamWrapper.php

function vfsStreamWrapper::stream_write

writes data into the stream

Parameters

string $data:

Return value

int amount of bytes written

File

vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php, line 450

Class

vfsStreamWrapper
Stream wrapper to mock file system requests.

Namespace

org\bovigo\vfs

Code

public function stream_write($data) {
    if (self::READONLY === $this->mode) {
        return 0;
    }
    if ($this->content
        ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) {
        return 0;
    }
    if (self::$quota->isLimited()) {
        $data = substr($data, 0, self::$quota->spaceLeft(self::$root->sizeSummarized()));
    }
    return $this->content
        ->write($data);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal