public function clearCache($ttl = self::DEFAULT_CACHE_TTL)
{
$ttl = (int) $ttl;
$dir = escapeshellcmd($this->_cacheDir);
$command = "find {$dir} \! -type d -amin +{$ttl} -exec rm -v '{}' ';'";
exec($command, $stringOutput);
return $stringOutput;
}
>>> import redis
>>> r = redis.Redis(host='localhost', port=6379, db=0)
>>> r.set('foo', 'bar')
True
>>> r.get('foo')
'bar'