SmsModel::__construct PHP Method

__construct() final public method

构造方法 - 获取短信数据配置
Author: Medz Seven ([email protected])
final public __construct ( $name = '' )
    public final function __construct($name = '')
    {
        parent::__construct($name);
        $conf = model('Xdata')->get('admin_Config:sms');
        $this->url = $conf['sms_server'];
        $this->param = $conf['sms_param'];
        $this->resultCode = strtolower($conf['success_code']);
        $this->type = $conf['send_type'];
        $this->provider = $conf['service'];
        $conf['template'] and $this->template = $conf['template'];
        unset($conf);
        $this->curl = curl_init();
        $this->code = rand(1000, 9999);
    }