PHP code example of dealnews / caching

1. Go to this page and download the library: Download dealnews/caching 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/ */

    

dealnews / caching example snippets




$cache = \DealNews\Caching\Cache::factory("app");
$value = $cache->get("somekey");
$cache->set("somekey", 1);
$cache->delete("somekey");
ini
; config.ini in your app base directory

[caching.memcache]
caching.memcache.app.servers = 10.0.0.1:11211,10.0.0.2:11211

[caching.redis]
caching.redis.sessions.servers = 10.0.0.3,10.0.0.4
; supports redis auth and other options that the
; predis/predis library supports such as sentinel replication
caching.redis.sessions.username = someuser
caching.redis.sessions.password = XXXXXXXX