Zend Framework  3.0
Public Member Functions | List of all members
MemoryManager Class Reference

Memory manager. More...

Public Member Functions

 __construct (CacheStorage $cache=null)
 Memory manager constructor.
 
 __destruct ()
 Object destructor.
 
 setMemoryLimit ($newLimit)
 Set memory grow limit.
 
 getMemoryLimit ()
 Get memory grow limit.
 
 setMinSize ($newSize)
 Set minimum size of values, which may be swapped.
 
 getMinSize ()
 Get minimum size of values, which may be swapped.
 
 create ($value= '')
 Create new Zend value container.
 
 createLocked ($value= '')
 Create new Zend value container, which has value always locked in memory.
 
 unlink (Container\Movable $container, $id)
 Unlink value container from memory manager.
 
 processUpdate (Container\Movable $container, $id)
 Process value update.
 
 load (Container\Movable $container, $id)
 Load value from swap file.
 

Detailed Description

Memory manager.

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

Constructor & Destructor Documentation

__construct ( CacheStorage  $cache = null)

Memory manager constructor.

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

Parameters
CacheStorage$cache
__destruct ( )

Object destructor.

Clean up cache storage

Member Function Documentation

create (   $value = '')

Create new Zend value container.

Parameters
string$value
Returns
Container
Exceptions
Exception\ExceptionInterface
createLocked (   $value = '')

Create new Zend value container, which has value always locked in memory.

Parameters
string$value
Returns
Container
Exceptions
Exception\ExceptionInterface
getMemoryLimit ( )

Get memory grow limit.

Returns
int
getMinSize ( )

Get minimum size of values, which may be swapped.

Returns
int
load ( Container\Movable  $container,
  $id 
)

Load value from swap file.

processUpdate ( Container\Movable  $container,
  $id 
)

Process value update.

This method is automatically invoked by memory container only once per "modification session", but user may call memory container touch() method several times depending on used algorithm. So we have to use this check to optimize this case.

setMemoryLimit (   $newLimit)

Set memory grow limit.

Parameters
int$newLimit
setMinSize (   $newSize)

Set minimum size of values, which may be swapped.

Parameters
int$newSize
unlink ( Container\Movable  $container,
  $id 
)

Unlink value container from memory manager.

Used by Memory container destroy() method