Documentation

Bucket
in package

Class \Hoa\Stream\Bucket.

Manipulate stream buckets through brigades.

Tags
copyright

Copyright © 2007-2017 Hoa community

license

New BSD License

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

$_brigade  : resource
Brigade.
$_bucket  : resource
Bucket.
$_type  : bool
Type of the bucket.

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
const

bool

IS_A_STREAM

Whether the stream is not a brigade.

public mixed IS_A_STREAM = false
Tags
const

bool

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 by self::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
bool

getBrigade()

Get the brigade.

public getBrigade() : resource
Return values
resource

getData()

Get bucket data.

public getData() : string
Return values
string

getLength()

Get bucket length.

public getLength() : int
Return values
int

getType()

Get type.

public getType() : bool
Return values
bool

prepend()

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
string

getBucket()

Get the current bucket.

protected getBucket() : mixed

setBrigade()

Set the brigade.

protected setBrigade(resource &$brigade) : resource
Parameters
$brigade : resource

Brigade to add.

Return values
resource

setBucket()

Set bucket.

protected setBucket(resource $bucket) : resource
Parameters
$bucket : resource

Bucket.

Return values
resource

setType()

Set type.

protected setType(bool $type) : bool
Parameters
$type : bool

Type. Please, see self::IS_A_* constants.

Return values
bool

        
On this page

Search results