API Documentation

Memory/Manager.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Memory
version
$Id: Manager.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Memory_Manager

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Memory_Manager

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Memory
Properties
$_backend
$_memoryLimit
$_minSize
$_memorySize
$_nextId
$_unloadCandidates
$_sizes
$_lastModified
$_managerId
$_tags
Methods
_generateMemManagerId
__construct
__destruct
setMemoryLimit
getMemoryLimit
setMinSize
getMinSize
create
createLocked
_create
unlink
processUpdate
_commit
_swapCheck
_swap
load

Description

Memory manager

This class encapsulates memory menagement operations, when PHP works in limited memory mode.

Properties

$_backend

Zend_Cache_Backend_Interface $_backend = 'null'

Object storage backend

Details

$_backend
Zend_Cache_Backend_Interface
visibility
private
default
null
final
false
static
false

$_lastModified

Zend_Memory_Container_Movable $_lastModified = 'null'

Last modified object

It's used to reduce number of calls necessary to trace objects' modifications Modification is not processed by memory manager until we do not switch to another object. So we have to trace only first object modification and do nothing for others

Details

$_lastModified
Zend_Memory_Container_Movable
visibility
private
default
null
final
false
static
false

$_managerId

integer $_managerId = ''

Unique memory manager id

Details

$_managerId
integer
visibility
private
default
final
false
static
false

$_memoryLimit

integer $_memoryLimit = '1'

Memory grow limit.

Default value is 2/3 of memory_limit php.ini variable Negative value means no limit

Details

$_memoryLimit
integer
visibility
private
default
1
final
false
static
false

$_memorySize

integer $_memorySize = '0'

Overall size of memory, used by values

Details

$_memorySize
integer
visibility
private
default
0
final
false
static
false

$_minSize

integer $_minSize = '16384'

Minimum value size to be swapped.

Default value is 16K Negative value means that memory objects are never swapped

Details

$_minSize
integer
visibility
private
default
16384
final
false
static
false

$_nextId

integer $_nextId = '0'

Id for next Zend_Memory object

Details

$_nextId
integer
visibility
private
default
0
final
false
static
false

$_sizes

array $_sizes = 'array'

List of object sizes.

This list is used to calculate modification of object sizes

array( => , ...)

Details

$_sizes
array
visibility
private
default
array
final
false
static
false

$_tags

array $_tags = ''

Tags array, used by backend to categorize stored values

Details

$_tags
array
visibility
private
default
final
false
static
false

$_unloadCandidates

array $_unloadCandidates = 'array'

List of candidates to unload

It also represents objects access history. Last accessed objects are moved to the end of array

array( => , ... )

Details

$_unloadCandidates
array
visibility
private
default
array
final
false
static
false

Methods

__construct

__construct( Zend_Cache_Backend $backend = null ) :

Memory manager constructor

If backend is not specified, then memory objects are never swapped

Arguments
$backend
Zend_Cache_Backend
Details
visibility
public
final
false
static
false

__destruct

__destruct( ) :

Object destructor

Clean up backend storage

Details
visibility
public
final
false
static
false

_commit

_commit( ) :

Commit modified object and put it back to the loaded objects list

Details
visibility
private
final
false
static
false

_create

_create( string $value, boolean $locked ) : Zend_Memory_Container_Interface

Create new Zend_Memory object

Arguments
$value
string
$locked
boolean
Details
visibility
private
final
false
static
false
throws

_generateMemManagerId

_generateMemManagerId( ) :

This function is intended to generate unique id, used by memory manager

Details
visibility
private
final
false
static
false

_swap

_swap( Zend_Memory_Container_Movable $container, integer $id ) :

Swap object data to disk Actualy swaps data or only unloads it from memory, if object is not changed since last swap

Arguments
$container
Zend_Memory_Container_Movable
$id
integer
Details
visibility
private
final
false
static
false

_swapCheck

_swapCheck( ) :

Check and swap objects if necessary

Details
visibility
private
final
false
static
false
throws

create

create( string $value ) : Zend_Memory_Container_Interface

Create new Zend_Memory value container

Arguments
$value
string
Details
visibility
public
final
false
static
false
throws

createLocked

createLocked( string $value ) : Zend_Memory_Container_Interface

Create new Zend_Memory value container, which has value always locked in memory

Arguments
$value
string
Details
visibility
public
final
false
static
false
throws

getMemoryLimit

getMemoryLimit( ) : integer

Get memory grow limit

Output
integer
Details
visibility
public
final
false
static
false

getMinSize

getMinSize( ) : integer

Get minimum size of values, which may be swapped

Output
integer
Details
visibility
public
final
false
static
false

load

load( Zend_Memory_Container_Movable $container, integer $id ) :

Load value from swap file.

Arguments
$container
Zend_Memory_Container_Movable
$id
integer
Details
visibility
public
final
false
static
false
internal

processUpdate

processUpdate( Zend_Memory_Container_Movable $container, integer $id ) :

Process value update

Arguments
$container
Zend_Memory_Container_Movable
$id
integer
Details
visibility
public
final
false
static
false
internal

setMemoryLimit

setMemoryLimit( integer $newLimit ) :

Set memory grow limit

Arguments
$newLimit
integer
Details
visibility
public
final
false
static
false
throws

setMinSize

setMinSize( integer $newSize ) :

Set minimum size of values, which may be swapped

Arguments
$newSize
integer
Details
visibility
public
final
false
static
false

unlink

unlink(  $container, integer $id ) : Zend_Memory_Container

Unlink value container from memory manager

Used by Memory container destroy() method

Arguments
$container
$id
integer
Details
visibility
public
final
false
static
false
internal
Documentation was generated by DocBlox.