listPush() public method

入队列
public listPush ( $list, $value, $direction, $repeat )
$list string 队列名
$value mixed 入队元素值
$repeat int 判断value是否存在 0:不判断存在 1:判断存在 如果value存在则不入队列
Example #1
0
 public static function savefd($fd, $kname = 'fd')
 {
     $redis_con = new phpredis();
     if ($redis_con->listSize($kname)) {
         $redis_con->listPush($kname, $fd, 0, 1);
     } else {
         $redis_con->listPush($kname, $fd);
     }
 }
Example #2
0
 public static function savefd($fd)
 {
     //$where=array('id' =>37936);
     $redis_con = new phpredis();
     if ($redis_con->listSize('fd')) {
         $redis_con->listPush('fd', $fd, 0, 1);
     } else {
         $redis_con->listPush('fd', $fd);
     }
     //file_put_contents( __DIR__ .'/log.txt' , $fd);
 }