connect(env('REDIS_IP'),env('REDIS_PORT'));//链接 self::$redis->auth(env('REDIS_PASSWORD'));//密码 } return self::$redis ; } public static function get( $key ){ $redis = self::_init(); return $redis->get($key); } public static function set( $key, $data){ $redis = self::_init(); return $redis->set( $key, $data); } public static function expire( $key, $time = 60 ){ $redis = self::_init(); return $redis->expire( $key, $time ); } public static function setnx( $key, $data){ $redis = self::_init(); return $redis->setnx( $key, $data); } public static function rpush( $key, $data){ $redis = self::_init(); return $redis->rpush( $key, $data); } public static function lpop( $key ){ $redis = self::_init(); return $redis->lpop( $key ); } public static function hSet( $table, $column, $value ){ $redis = self::_init(); return $redis->hSet( $table, $column, $value ); } public static function hGet( $table, $column ){ $redis = self::_init(); return $redis->hGet( $table, $column ); } public static function hDel( $table, $column ){ $redis = self::_init(); return $redis->hDel( $table, $column ); } }