Sophie

Sophie

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

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

<?php

require_once 'tutorial_autoload.php';

$stack = new ezcCacheStack( 'stack' );

$stack->pushStorage(
    new ezcCacheStackStorageConfiguration(
        'file',
        $fileStorage,
        1000000,
        .5
    )
);
$stack->pushStorage(
    new ezcCacheStackStorageConfiguration(
        'apc',
        $apcStorage,
        1000,
        .3
    )
);

$stack->options->replacementStrategy = 'ezcCacheStackLfuReplacementStrategy';

// ... somewhere else...

$stack->store(
    'id_1', 'id_1_data'
);
$stack->store(
    'id_2', 'id_2_data', array( 'attribute' => 'value' )
);
$id1data = $stack->restore( 'id_1' );

?>