Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saksmt/php-streams
Another abstraction over output.
https://github.com/saksmt/php-streams
Last synced: about 2 months ago
JSON representation
Another abstraction over output.
- Host: GitHub
- URL: https://github.com/saksmt/php-streams
- Owner: saksmt
- Created: 2015-08-11T13:26:15.000Z (over 9 years ago)
- Default Branch: develop
- Last Pushed: 2015-08-11T13:38:11.000Z (over 9 years ago)
- Last Synced: 2024-04-29T07:43:49.973Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
smt/streams
===========Another abstraction over output.
Key-features
------------Redirecting to another stream.
Installation
------------composer require smt/streams
Usage
-----use Smt\Streams\SymfonyOutputStream;
use Smt\Streams\FileStream;
use Smt\Streams\DummyStream;$outStream = new SymfonyOutputStream($out);
$outStream
->write('Hello')
->redirect(new FileStream('truth.txt'))
->write('Time')
->write(' to')
->write(' take')
->write(' over')
->write(' the')
->setRedirectMode(FileStream::WRITE_REDIRECT)
->writeln('world')
;
// Symfony out - "Hello world"
// truth.txt - "Time to take over the world"