PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Creating a Memory Manager

You can create new a memory manager (Zend_Memory_Manager object) using the Zend_Memory::factory($backendName [, $backendOprions]) method.

The first argument $backendName is a string that names one of the backend implementations supported by Zend_Cache.

The second argument $backendOptions is an optional backend options array.

<?php
$backendOptions 
= array(
    
'cache_dir' => './tmp/' // Directory where to put the swapped memory blocks
);

$memoryManager Zend_Memory::factory('File'$backendOptions);

Zend_Memory uses Zend_Cache backends as storage providers.

You may use the special name 'None' as a backend name, in addition to standard Zend_Cache backends.

<?php
$memoryManager 
Zend_Memory::factory('None');

If you use 'None' as the backend name, then the memory manager never swaps memory blocks. This is useful if you know that memory is not limited or the overall size of objects never reaches the memory limit.

The 'None' backend doesn't need any option specified.

Zend Framework