<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * Description of incr * * @author changdi */ //require __DIR__.'/shared.php'; require '../shared.php'; $predis = new Predis\Client($single_server); var_dump($predis->get('key')); var_dump($predis->incr('key')); //var_dump($predis->incr('key',15)); var_dump($predis->decr('key'));
<?php include_once '../../common.php'; include_once S_ROOT . './source/function_space.php'; include_once 'verify.php'; $uid = $_SGLOBAL['supe_uid']; require 'Predis/Autoloader.php'; Predis\Autoloader::register(); $client = new Predis\Client(); $keyT = 'ihome_T' . $uid; $keyR = 'ihome_R' . $uid; $value = $client->decr($keyT); if ($value <= 0) { $client->del($keyT); $client->del($keyR); }