Download the PHP package exsyst/io without Composer
On this page you can find all versions of the php package exsyst/io. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package io
EXSyst I/O Component
Object-oriented I/O facility
s
The objects (objects implementing ) can be used to read raw chunks of data from several sources :
- s can be used to read data from a string ;
- s can be used to read data from a PHP stream resource, without protection from most flaws in the implementation of the wrapped PHP stream ; they can also be used as s (read more in the next section) if the stream is writable or bidirectional ;
- s can be used to wrap other sources, in order to fix several flaws which their implementation may have, and add missing features (for example, haven't you already needed, if only once, to seek backwards on a socket ?) ;
- s are abstract : you may extend them to provide additional services on existing s (for example, s and s are s).
You may create s directly from the classes' constructors, or using static methods from the class, which may provide additional services (for example, and automatically wrap the s in s by default).
The class also provides static utility methods.
s
The objects (objects implementing ) can be used to write raw chunks of data to several sinks :
- s can be used to build strings (but may be slower than plain concatenation : beware of call overhead !) ;
- The is a simple wrapper for ; it is a singleton ;
- s can be used to aggregate data into records (of fixed size, or delimited by a separator, with an optional size limit) and pass them to a custom function ;
- s (see the previous section) which wrap a writable or bidirectional stream can be used to write data to a PHP stream resource ;
- s can be used to duplicate data into multiple s.
Like the class, the class provides static methods which can be used to easily create s, and static utility methods.
s
The objects (objects implementing ) can be obtained by calling on a which supports it. They can be used to rewind the to a previous position using the method.
You can wrap your in a if you need to rewind it and if it doesn't support it.
s
The objects (which do not implement any specific interface, as they provide much different services) can be used to read structured data from s :
- s can be used to ease the writing of lexers : they support ing fixed strings, strings including or excluding only given character classes, and white space ;
- s are s optimized for s, which additionally suppport ing strings matching a regular expression (using ) ;
- s can be used to separate concatenated d values (as in ), regardless of whether they come from a local (such as a string or a file stream) or a remote one (such as a pipe or network stream) ; they are explicitly designed to work efficiently with remote s ;
- s can be used to separate concatenated JSON (as specified by RFC 7159) values, in the same conditions as .
It is recommended to create s using the static method : it will automatically prefer an optimized implementation (such as ) when applicable.
s
The objects (objects implementing ) can be used to communicate with remote tasks using messages, which will be serialized if necessary :
- s serialize the messages using the native PHP format (with ) ;
- s serialize the messages using JSON (as specified by RFC 7159).
The objects (objects implementing ) can be used by an application or a library to specify an encoder/decoder couple, along with their parameters, to another library.
s
The objects (objects implementing ) are objects which wrap PHP streams. They can be passed to the static methods of the class, which are object-oriented wrappers to . These methods can look for s wrapped in arbitrarily many s, and will let the originally passed objects (not the inner s) in the sets on return.
Many objects are : s, all s, and objects of the class itself : in addition to its static utility methods, it provides a bare-bones implementation of the interface (which you can use to, for example, add a server socket to your set).