You are here

public function Stream::isWritable in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/zendframework/zend-diactoros/src/Stream.php \Zend\Diactoros\Stream::isWritable()
  2. 8.0 vendor/guzzlehttp/psr7/src/Stream.php \GuzzleHttp\Psr7\Stream::isWritable()
  3. 8.0 vendor/symfony/psr-http-message-bridge/Tests/Fixtures/Stream.php \Symfony\Bridge\PsrHttpMessage\Tests\Fixtures\Stream::isWritable()
Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-diactoros/src/Stream.php \Zend\Diactoros\Stream::isWritable()

Returns whether or not the stream is writable.

Return value

bool

Overrides StreamInterface::isWritable

1 call to Stream::isWritable()
Stream::write in vendor/zendframework/zend-diactoros/src/Stream.php
Write data to the stream.
1 method overrides Stream::isWritable()
PhpInputStream::isWritable in vendor/zendframework/zend-diactoros/src/PhpInputStream.php
Returns whether or not the stream is writable.

File

vendor/zendframework/zend-diactoros/src/Stream.php, line 183

Class

Stream
Implementation of PSR HTTP streams

Namespace

Zend\Diactoros

Code

public function isWritable() {
  if (!$this->resource) {
    return false;
  }
  $meta = stream_get_meta_data($this->resource);
  $mode = $meta['mode'];
  return strstr($mode, 'x') || strstr($mode, 'w') || strstr($mode, 'c') || strstr($mode, 'a') || strstr($mode, '+');
}