ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
# 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中定义的方法。用户获取用户的输入。