\Horde_Stream_TempString

Implementation of Horde_Stream that uses a PHP native string variable until a certain size is reached, at which point it converts storage to a PHP temporary stream.

NOTE: Do NOT use this class if it's possible that a stream_filter will need to be added to the stream by some client code. If the size of the data does not exceed max_memory there will be no stream to attach to.

Summary

Methods
Properties
Constants
__construct()
__get()
__set()
__clone()
__toString()
add()
length()
getToChar()
peek()
search()
getString()
substring()
getEOL()
getChar()
pos()
rewind()
seek()
end()
eof()
close()
serialize()
unserialize()
$stream
$use_stream
$utf8_char
No constants found
_init()
$_params
$_utf8_char
$_string
N/A
No private methods found
No private properties found
N/A

Properties

$stream

$stream : resource

Stream resource.

Type

resource

$use_stream

$use_stream : boolean

If true, the object is using a PHP temp stream internally.

Type

boolean

$utf8_char

$utf8_char : boolean

Parse character as UTF-8 data instead of single byte (@since 1.4.0).

Type

boolean

$_params

$_params : array

Configuration parameters.

Type

array

$_utf8_char

$_utf8_char : boolean

Parse character as UTF-8 data instead of single byte.

Type

boolean

Methods

__construct()

__construct(array  $opts = array()) 

Constructor.

Parameters

array $opts

Additional configuration options:

  - max_memory: (integer) The maximum amount of memory to allocate to
                the PHP temporary stream.

__get()

__get(  $name) 

Parameters

$name

__set()

__set(  $name,   $value) 

Parameters

$name
$value

__clone()

__clone() 

__toString()

__toString() 

add()

add(  $data,   $reset = false) 

Parameters

$data
$reset

length()

length(  $utf8 = false) 

Parameters

$utf8

getToChar()

getToChar(  $end,   $all = true) 

Parameters

$end
$all

peek()

peek(  $length = 1) 

Parameters

$length

search()

search(  $char,   $reverse = false,   $reset = true) 

Parameters

$char
$reverse
$reset

getString()

getString(  $start = null,   $end = null) 

Parameters

$start
$end

substring()

substring(  $start,   $length = null,   $char = false) 

Parameters

$start
$length
$char

getEOL()

getEOL() : string

Auto-determine the EOL string.

Returns

string —

The EOL string, or null if no EOL found.

getChar()

getChar() 

pos()

pos() 

rewind()

rewind() 

seek()

seek(  $offset,   $curr = true,   $char = false) 

Parameters

$offset
$curr
$char

end()

end(  $offset) 

Parameters

$offset

eof()

eof() 

close()

close() 

Close the stream.

serialize()

serialize() 

unserialize()

unserialize(  $data) 

Parameters

$data

_init()

_init() 

Initialization method.