多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# clearState 开服前的清理操作,只支持同步的写法。 例子: ```php public function clearState() { print("是否清除Redis上的用户状态信息(y/n)?"); $clear_redis = shell_read(); if (strtolower($clear_redis) == 'y') { echo "[初始化] 清除Redis上用户状态。\n"; $this->getRedis()->del(SwooleMarco::redis_uid_usid_hash_name); $this->getRedis()->close(); unset($this->redis_client); } } ``` shell_read是在Common.php中定义的方法。用户获取用户的输入。