/** * Constructor * * @param array $curlOpts 用于内部http包装对象使用的全局curl参数. */ public function __construct($curlOpts = array()) { date_default_timezone_set('Asia/Shanghai'); self::$suppressException = config('pusher.suppess_excption'); $this->log = new PushSimpleLog(config('pusher.log_output'), config('pusher.log_level')); try { $this->http = new HttpRequest(config('pusher.host'), $curlOpts, $this->log); $this->log->log("HttpRequest: ready to work..."); } catch (Exception $e) { $this->log->fault($e->__toString()); die; } $this->assert = new AssertHelper(); $this->signExpires = intval(config('pusher.sign_expires')); $this->log->log("SDK: initializing..."); }
/** * Constructor * * @param array $curlOpts 用于内部http包装对象使用的全局curl参数. */ function __construct($curlOpts = array()) { date_default_timezone_set('Asia/Shanghai'); self::$suppressException = BAIDU_PUSH_CONFIG::SUPPRESS_EXCPTION; $this->log = new PushSimpleLog(BAIDU_PUSH_CONFIG::LOG_OUTPUT, BAIDU_PUSH_CONFIG::LOG_LEVEL); try { $this->http = new HttpRequest(BAIDU_PUSH_CONFIG::HOST, $curlOpts, $this->log); $this->log->log("HttpRequest: ready to work..."); } catch (Exception $e) { $this->log->fault($e->__toString()); die; } $this->assert = new AssertHelper(); $this->signExpires = intval(BAIDU_PUSH_CONFIG::SIGN_EXPIRES); $this->log->log("SDK: initializing..."); }