SmsModel::sendCaptcha PHP Method

sendCaptcha() public method

发送验证码
Author: Medz Seven ([email protected])
public sendCaptcha ( integer $phone, boolean $sendLock = false ) : boolean
$phone integer 要发送到的手机号码
$sendLock boolean 发送锁,默认关闭
return boolean
    public function sendCaptcha($phone, $sendLock = false)
    {
        $this->phone = $phone;
        /* # 前置检查必要信息 */
        if (!$this->allBefore()) {
            return false;
            /* # 检查锁 */
        } elseif ($sendLock and $this->lock()) {
            return false;
        }
        $this->buildParam();
        $this->InLock();
        $debug = false;
        if (isset($_REQUEST['client_debuging'])) {
            $this->setMessage($this->getCode());
            $debug = true;
            $result = false;
        }
        if ($debug || ($result = $this->send())) {
            $this->add(array('phone' => $this->phone, 'code' => $this->code, 'time' => time()));
        }
        return $result;
    }