stream_flush ()

Flushes the output. This method is called in response to fflush(). If you have cached data in your stream but not yet stored it into the underlying storage, you should do so now.

Since this implementation doesn’t buffer streams, simply return true.

Access

public

Returns

Type

Description

boolean

Whether or not flushing succeeded

Source

Method defined in extensions/s3streamwrapper.class.php | Toggle source view (19 lines) | View on GitHub

public function stream_flush()
{
    if ($this->buffer === null)
    {
        return false;
    }

    list($protocol, $bucket, $object_name) = $this->parse_path($this->path);

    $response = $this->client($protocol)->create_object($bucket, $object_name, array(
        'body' => $this->buffer,
    ));

    $this->seek_position = 0;
    $this->buffer = null;
    $this->eof = true;

    return $response->isOK();
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback