PHP code example of sergiors / doctrine-cache-service-provider

1. Go to this page and download the library: Download sergiors/doctrine-cache-service-provider 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/ */

    

sergiors / doctrine-cache-service-provider example snippets


use Sergiors\Pimple\Provider\DoctrineCacheServiceProvider;

$app->register(new DoctrineCacheServiceProvider(), [
    'cache.options' => [
        'driver' => 'redis',
        'namespace' => 'myapp',
        'host' => '{your_host}',
        'port' => '{your_portt}',
        // 'password' => ''
    ]
]);

// $app['cache']->save('cache_id', 'my_data');
// $app['cache']->fetch('cache_id');

use Sergiors\Pimple\Provider\DoctrineCacheServiceProvider;

$app->register(new DoctrineCacheServiceProvider(), [
    'caches.options' = [
        'conn1' => 'xcache',
        'conn2' => [
            'driver' => 'redis'
        ],
        'conn3' => [
            'driver' => 'array',
            'namespace' => 'test'
        ]
    ]
]);

// $app['caches']['conn1'];
// $app['caches']['conn2'];
// $app['caches']['conn3'];