Trait StreamTrait
NOTE: Most of this was ported from a prior build. Method documentation and some stability refactoring will be added throughout the alpha and beta phase of Oroboros core for code ported
from legacy builds.
Traits provide extended method support to classes without requiring a direct, linear chain of inheritance. This allows functions to inherit subsets of related methods without declaring a parent class.
In Oroboros core, ALL methods are granted to classes via traits, and the classes themselves are just containers that correlate their methods to an interface they are expected to honor. This approach maximizes interoperability, by entirely removing class inheritance as a requirement for extension of any class in this system.
3rd parties using this package are not expected to follow this approach,
but ALL of our internal class and logic structure does.
Direct Known Users
oroboros\core\abstracts\libraries\stream\AbstractStream
,
oroboros\core\traits\libraries\stream\MessageTrait
Indirect Known Users
Package: oroboros\core\psr7
Category: traits
License: The MIT License (MIT)
Author: Brian Dayhoff mopsyd@me.com
Version: 0.2.4
Since: 0.2.4-alpha
Used by: oroboros\core\interfaces\api\psr\Psr7Api::STREAM_ABSTRACT_CLASS
Link: bitbucket.org/oroborosframework/oroboros-core/wiki/development/api/traits.md
Satisfies: \oroboros\core\interfaces\contract\libraries\stream\StreamContract
Satisfies: \Psr\Http\Message\StreamInterface
Located at core/traits/libraries/stream/StreamTrait.php
Methods summary
public
|
|
public
|
#
__destruct( )
|
public
string
|
|
public
|
|
public
string
|
|
public
resource|null
|
|
public
integer
|
|
public
|
|
public
integer
|
|
public
array|mixed|null
|
#
getMetadata( string $key = null )
Get stream metadata as an associative array or retrieve a specific key. |
public
boolean
|
|
public
string
|
|
public
|
|
public
boolean
|
|
public
integer|null
|
|
public
boolean
|
|
public
boolean
|
|
protected
|
|
private
|
#
_createCacheStreamFile( )
Creates a cache stream file, in the event that the passed stream represents a resource that cannot be reused. |
private
string
|
#
_createStreamCacheFileName( )
Creates a non-colliding cache name, based off of the values in the cache directory. |
Properties summary
private
boolean
|
$_purge_file_on_destruct
|
#
false
|
private
|
$_cache_file
|
|
private
|
$_stream
|
|
private
|
$_readable
|
|
private
|
$_writeable
|
|
private
|
$_seekable
|
|
private
|
$_size
|
|
private
|
$_uri
|
|
private
|
$_meta
|
|
private
integer
|
$_offset
|
#
0
|