Bucket
in package
Class \Hoa\Stream\Bucket.
Manipulate stream buckets through brigades.
Tags
Table of Contents
Constants
- IS_A_BRIGADE = true
- Whether the stream is already a brigade.
- IS_A_STREAM = false
- Whether the stream is not a brigade.
Properties
Methods
- __construct() : mixed
- Set a brigade.
- append() : void
- Append bucket to the brigade.
- eob() : bool
- Test the end-of-bucket.
- getBrigade() : resource
- Get the brigade.
- getData() : string
- Get bucket data.
- getLength() : int
- Get bucket length.
- getType() : bool
- Get type.
- prepend() : void
- Prepend bucket to the brigade.
- setData() : string
- Set bucket data.
- getBucket() : mixed
- Get the current bucket.
- setBrigade() : resource
- Set the brigade.
- setBucket() : resource
- Set bucket.
- setType() : bool
- Set type.
Constants
IS_A_BRIGADE
Whether the stream is already a brigade.
public
mixed
IS_A_BRIGADE
= true
Tags
IS_A_STREAM
Whether the stream is not a brigade.
public
mixed
IS_A_STREAM
= false
Tags
Properties
$_brigade
Brigade.
protected
resource
$_brigade
= null
$_bucket
Bucket.
protected
resource
$_bucket
= null
$_type
Type of the bucket.
protected
bool
$_type
= null
Methods
__construct()
Set a brigade.
public
__construct(resource &$brigade[, bool $is = self::IS_A_BRIGADE ][, string $buffer = '' ]) : mixed
If a stream is given (with the constant self::IS_A_STREAM
), it will
create a brigade automatically.
Parameters
- $brigade : resource
-
A stream or a brigade.
- $is : bool = self::IS_A_BRIGADE
-
Specify if
$brigade
is a stream or a brigade, given byself::IS_A_*
constant. - $buffer : string = ''
-
Stream buffer.
append()
Append bucket to the brigade.
public
append(Bucket $bucket) : void
Parameters
- $bucket : Bucket
-
Bucket to add.
eob()
Test the end-of-bucket.
public
eob() : bool
When testing, set the new bucket object.
Return values
boolgetBrigade()
Get the brigade.
public
getBrigade() : resource
Return values
resourcegetData()
Get bucket data.
public
getData() : string
Return values
stringgetLength()
Get bucket length.
public
getLength() : int
Return values
intgetType()
Get type.
public
getType() : bool
Return values
boolprepend()
Prepend bucket to the brigade.
public
prepend(Bucket $bucket) : void
Parameters
- $bucket : Bucket
-
Bucket to add.
setData()
Set bucket data.
public
setData(string $data) : string
Parameters
- $data : string
-
Data to set.
Return values
stringgetBucket()
Get the current bucket.
protected
getBucket() : mixed
setBrigade()
Set the brigade.
protected
setBrigade(resource &$brigade) : resource
Parameters
- $brigade : resource
-
Brigade to add.
Return values
resourcesetBucket()
Set bucket.
protected
setBucket(resource $bucket) : resource
Parameters
- $bucket : resource
-
Bucket.
Return values
resourcesetType()
Set type.
protected
setType(bool $type) : bool
Parameters
- $type : bool
-
Type. Please, see self::IS_A_* constants.