StreamFactory
in package
implements
StreamFactoryInterface
Phrity\Net\StreamFactory class.
Tags
Table of Contents
Interfaces
Properties
Methods
- __construct() : mixed
- Create new stream wrapper instance.
- createSocketClient() : SocketClient
- Create a new socket client.
- createSocketServer() : SocketServer
- Create a new socket server.
- createSocketStreamFromResource() : SocketStream
- Create a new ocket stream from an existing resource.
- createStream() : Stream
- Create a new stream from a string.
- createStreamCollection() : StreamCollection
- Create a new stream collection.
- createStreamFromFile() : Stream
- Create a stream from an existing file.
- createStreamFromResource() : Stream
- Create a new stream from an existing resource.
Properties
$handler
private
mixed
$handler
$modes
private
static mixed
$modes
= ['r', 'r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+', 'e']
Methods
__construct()
Create new stream wrapper instance.
public
__construct() : mixed
createSocketClient()
Create a new socket client.
public
createSocketClient(UriInterface $uri) : SocketClient
Parameters
- $uri : UriInterface
-
The URI to connect to.
Return values
SocketClient —A socket client instance.
createSocketServer()
Create a new socket server.
public
createSocketServer(UriInterface $uri) : SocketServer
Parameters
- $uri : UriInterface
-
The URI to create server on.
Return values
SocketServer —A socket server instance.
createSocketStreamFromResource()
Create a new ocket stream from an existing resource.
public
createSocketStreamFromResource(resource $resource) : SocketStream
The stream MUST be readable and may be writable.
Parameters
- $resource : resource
-
The PHP resource to use as the basis for the stream.
Return values
SocketStream —A socket stream instance.
createStream()
Create a new stream from a string.
public
createStream([string $content = '' ]) : Stream
Parameters
- $content : string = ''
-
String content with which to populate the stream.
Return values
Stream —A stream instance.
createStreamCollection()
Create a new stream collection.
public
createStreamCollection() : StreamCollection
Return values
StreamCollection —A stream collection.
createStreamFromFile()
Create a stream from an existing file.
public
createStreamFromFile(string $filename[, string $mode = 'r' ]) : Stream
Parameters
- $filename : string
-
The filename or stream URI to use as basis of stream.
- $mode : string = 'r'
-
The mode with which to open the underlying filename/stream.
Tags
Return values
Stream —A stream instance.
createStreamFromResource()
Create a new stream from an existing resource.
public
createStreamFromResource(resource $resource) : Stream
The stream MUST be readable and may be writable.
Parameters
- $resource : resource
-
The PHP resource to use as the basis for the stream.
Return values
Stream —A stream instance.