blob: 5c28bbce80681b321eee886c95b998d5a8fd4a5f [file] [log] [blame]
<?php
require_once 'tutorial_autoload.php';
class myCustomConfigurator implements ezcCacheStackConfigurator
{
public static function configure( ezcCacheStack $stack )
{
// ... create your storages here or fetch from manager...
$stack->pushStorage(
new ezcCacheStackStorageConfiguration(
'file',
$fileStorage,
1000000,
.5
)
);
$stack->pushStorage(
new ezcCacheStackStorageConfiguration(
'apc',
$apcStorage,
1000,
.3
)
);
}
}
$stackOptions = array(
'bubbleUpOnRestore' => true,
'configurator' => 'myCustomConfigurator',
);
$stack = new ezcCacheStack( 'stack' );
ezcCacheManager::createCache(
'stack',
'stack',
'ezcCacheStack',
$stackOptions
);
// ... somewhere else...
$stack = ezcCacheManager::getCache( 'stack' );
?>