PHP code example of phpsoftbox / cache

1. Go to this page and download the library: Download phpsoftbox/cache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpsoftbox / cache example snippets


use PhpSoftBox\Cache\Configurator\CacheBuilder;

$config = [
    'default' => 'default',
    'stores' => [
        'default' => [
            'driver' => 'array',
            'namespace' => 'app',
            'default_ttl' => 60,
        ],
    ],
];

$cache = CacheBuilder::fromConfig($config);

$cache->store()->set('foo', 'bar', 30);
bash
php psb cache:prune
php psb cache:prune --store=default --tmp-max-age-hours=24 --max-age-days=30