Documentation

LateComputed extends Basic
in package

AbstractYes

Class \Hoa\Stream\Filter\LateComputed.

A late computed filter computes the data when closing the filtering.

Tags
copyright

Copyright © 2007-2017 Hoa community

license

New BSD License

Table of Contents

Constants

FATAL_ERROR  = PSFS_ERR_FATAL
The filter experienced and unrecoverable error and cannot continue.
FEED_ME  = PSFS_FEED_ME
Filter processed successfully, however no data was available to return.
FLAG_FLUSH_CLOSE  = PSFS_FLAG_FLUSH_CLOSE
Final flush prior to closing.
FLAG_FLUSH_INC  = PSFS_FLAG_FLUSH_INC
An incremental flush.
FLAG_NORMAL  = PSFS_FLAG_NORMAL
Regular read/write.
PASS_ON  = PSFS_PASS_ON
Filter processed successfully with data available in the out bucket brigade.

Properties

$_buffer  : string
Buffer.

Methods

filter()  : int
Filter data.
getName()  : string
Get the filter name.
getParameters()  : mixed
Get the filter parameters.
getStream()  : resource
Get the stream resource being filtered.
onClose()  : void
Called upon filter shutdown (typically, this is also during stream shutdown), and is executed after the flush method is called.
onCreate()  : bool
Called during instanciation of the filter class object.
setName()  : string
Set the filter name.
setParameters()  : mixed
Set the filter parameters.
compute()  : string
Compute the whole data (stored in $this->_buffer).

Constants

FATAL_ERROR

The filter experienced and unrecoverable error and cannot continue.

public mixed FATAL_ERROR = PSFS_ERR_FATAL
Tags
const

int

FEED_ME

Filter processed successfully, however no data was available to return.

public mixed FEED_ME = PSFS_FEED_ME

More data is required from the stream or prior filter.

Tags
const

int

FLAG_FLUSH_CLOSE

Final flush prior to closing.

public mixed FLAG_FLUSH_CLOSE = PSFS_FLAG_FLUSH_CLOSE
Tags
const

int

FLAG_FLUSH_INC

An incremental flush.

public mixed FLAG_FLUSH_INC = PSFS_FLAG_FLUSH_INC
Tags
const

int

FLAG_NORMAL

Regular read/write.

public mixed FLAG_NORMAL = PSFS_FLAG_NORMAL
Tags
const

int

PASS_ON

Filter processed successfully with data available in the out bucket brigade.

public mixed PASS_ON = PSFS_PASS_ON
Tags
const

int

Properties

Methods

filter()

Filter data.

public filter(resource $in, resource $out, int &$consumed, bool $closing) : int

This method is called whenever data is read from or written to the attach stream.

Parameters
$in : resource

A resource pointing to a bucket brigade which contains one or more bucket objects containing data to be filtered.

$out : resource

A resource pointing to a second bucket brigade into which your modified buckets should be replaced.

$consumed : int

Which must always be declared by reference, should be incremented by the length of the data which your filter reads in and alters.

$closing : bool

If the stream is in the process of closing (and therefore this is the last pass through the filterchain), the closing parameter will be set to true.

Return values
int

getName()

Get the filter name.

public getName() : string
Return values
string

getParameters()

Get the filter parameters.

public getParameters() : mixed

getStream()

Get the stream resource being filtered.

public getStream() : resource

Maybe available only during filter calls when the closing parameter is set to false.

Return values
resource

onClose()

Called upon filter shutdown (typically, this is also during stream shutdown), and is executed after the flush method is called.

public onClose() : void

onCreate()

Called during instanciation of the filter class object.

public onCreate() : bool
Return values
bool

setName()

Set the filter name.

public setName(string $name) : string
Parameters
$name : string

Filter name.

Return values
string

setParameters()

Set the filter parameters.

public setParameters(mixed $parameters) : mixed
Parameters
$parameters : mixed

Filter parameters.

compute()

Compute the whole data (stored in $this->_buffer).

protected abstract compute() : string
Return values
string

        
On this page

Search results