Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > b9acef47780b816a3a75371f0bb1d901 > files > 17

php-ezc-Cache-1.5-1.fc13.noarch.rpm

<?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' );

?>