2017 © Pedro Peláez
 

library stream-util

Helper utilities for dealing with streams.

image

twistor/stream-util

Helper utilities for dealing with streams.

  • Friday, June 12, 2015
  • by twistor
  • Repository
  • 1 Watchers
  • 2 Stars
  • 200,638 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 11 % Grown

The README.md

Stream Utilities

Author Build Status Coverage Status Quality Score Software License Packagist Version, (*1)

Helper functions for dealing with streams., (*2)

Installation

composer require twistor/stream-util

Usage

use Twistor\StreamUtil;

$stream = fopen('php://temp', 'w+b');

fwrite($stream, 'asdfasfdas');

$cloned = StreamUtil::copy($stream, false); // Passing in true (the default),
                                            // will close the input stream.

StreamUtil::getSize($stream); // 10

StreamUtil::isAppendable($stream); // false

StreamUtil::isReadable($stream); // true

StreamUtil::isSeekable($stream); // true

StreamUtil::isWritable($stream); // true

StreamUtil::tryRewind($stream);  // true

StreamUtil::trySeek($stream, 0, SEEK_END); // true

// Metadata helpers.
StreamUtil::getMetaDataKey($stream, 'blocked') // false

StreamUtil::getUri($stream); // php://temp

StreamUtil::getUsuableUri($stream); // Returns a URI that can be used
                                    // with fopen().
                                    // false in this case.

// Mode helpers.
StreamUtil::modeIsAppendable('w+'); // false

StreamUtil::modeIsAppendOnly('a+'); // false

StreamUtil::modeIsReadable('w+');   // true

StreamUtil::modeIsReadOnly('r');    // true

StreamUtil::modeIsWritable('r+');   // true

StreamUtil::modeIsWriteOnly('w');   // true

The Versions

12/06 2015

dev-master

9999999-dev http://github.com/twistor/stream-util

Helper utilities for dealing with streams.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Chris Leppanen

12/06 2015

v1.0.1

1.0.1.0 http://github.com/twistor/stream-util

Helper utilities for dealing with streams.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Chris Leppanen

29/05 2015

v1.0.0

1.0.0.0 http://github.com/twistor/stream-util

Helper utilities for dealing with streams.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Chris Leppanen