Lines Matching refs:to

35   * Context: Allow to pass options and parameters to the stream
38 destination of a stream, useful for instance to encrypt/decrypt a
55 With [Composer](https://getcomposer.org/), to include this library into
56 your dependencies, you need to
74 Then, to run all the test suites:
85 As a quick overview, we propose to discover what `Hoa\Stream` provides
87 most important part of this library. Then, how to define a stream,
88 followed by how to use stream contexts. Events, listeners and
100 * `In`, to read from a stream, provides `read`, `readInteger`,
102 * `Out`, to write onto a stream, provides `write`, `writeArray`,
108 * `Lockable`, to lock a stream, provides `lock` and several
113 * `Pointable`, to move the internal pointer of the stream if any,
115 * `Statable`, to get statistics about a stream, provides `getSize`,
122 Thus, if one only need to read from a stream, it will type the stream
123 with `Hoa\Stream\IStream\In`. It also allows an implementer to choose
133 implementations are left to the user: `_open` and : `_close`,
134 respectively to open a particular stream, and to close this particular
161 $file = new BasicFile('/path/to/file');
181 Other methods are left as an exercise to the reader. Thus, we are now
182 able to:
196 as an example of possible ones. Thanks to context, this is possible to
197 add HTTP headers for instance, or to specify the proxy, the maximum
211 And thus, we can ask a stream to use this context based on the chosen
215 $basicFile = new BasicFile('/path/to/file', $contextId);
219 methods on the `Hoa\Stream\Context` class will be useful to
221 according to them.
231 `hoa://Event/Stream/<streamName>:close-before`. Thus, for instance, to
232 execute a function before the `/path/to/file` stream closes, one
236 Hoa\Event\Event::getEvent('hoa://Event/Stream//path/to/file:close-before')->attach(
253 Now let's move on to listeners. To register a listener, we must create
256 argument of the default `Hoa\Stream\Stream` constructor; `true` to
260 $file = new BasicFile('/path/to/file', null, true);
266 must manually call the `open` method to open the stream then. Between
272 —in the context of stream— refers to them as notifications. Let's take
290 echo 'Redirection to ', $bucket->getData()['message'], "\n";
321 Redirection to /En/
337 * `redirect`, when the stream is redirected to another stream,
355 * `max`, total number of bytes to transfer.
357 This is possible for the stream implementer to add more
364 A stream wrapper allows to declare schemes, like `hoa://` or
370 The `Hoa\Stream\Wrapper\Wrapper` class holds all methods to
382 The `Stream` interface requires to implement several methods related to a stream, such as:
400 The `File` interface requires to implement other methods related to stream acting as a file, such a…
412 It does not depend on this library to avoid dependencies, but the code
418 possible to cut this pipe in two pieces, and insert a small part: A
426 This class allows to `register` or `remove` filters. A filter takes
433 “decrypt”, “unzip”, “transform to…”. In such a scenario, the order
438 an `Hoa\Stream` instance will obviously unwraps to its underlying PHP
493 like decrypt, transform to, unzip… Actually, PHP comes with certain
506 rewrite parts of the file. This technique is particularily useful to
509 This is also possible to auto-apply a filter with… a wrapper! For
510 example the `instrument://` wrapper can prepend a filter to the stream
518 There are more to cover. `Hoa\Stream` supports composite streams (with
525 allows a string to be manipulated with a stream API, so the stream
533 detailed information about how to use this library and how it works.
547 There are mainly two ways to get help:
555 Do you want to contribute? Thanks! A detailed [contributor
557 everything you need to know.