Example #1
0
 public function __construct($message, $argv = null, $level = Arch_Exception::WARNING)
 {
     if ($level == Arch_Exception::WARNING) {
         Arch_Log::warning($message, $argv);
     } else {
         Arch_Log::fatal($message, $argv);
     }
     parent::__construct($message, 0, null);
 }
Example #2
0
 /**
  * 发送消息给设备
  *
  * @param string $cid 设备的标记
  * @param string $title 标题,IOS忽略这个参数
  * @param string $body 正文信息 IOS忽略这个参数
  * @param string $device 1:安卓 2:ios
  * @param int $edage APP图标上显示的数字
  * @param string $data 透传出的数据
  */
 public function sendToSingle($cid, $title, $body, $device = 1, $edage = 0, $data = '')
 {
     try {
         if (1 == $device) {
             $template = $this->androidTemplate($title, $body, $data, $edage);
         } else {
             $template = $this->iosTemplate($title, $data, $edage);
         }
         $rev = $this->pushMessageToSingle($cid, $template);
     } catch (Exception $e) {
         Arch_Log::warning(sprintf("Push fail{%s}", $e->getMessage()));
         return false;
     }
     return true;
 }
Example #3
0
 public static function set($opt = array())
 {
     self::$opt = array_merge(self::$opt, $opt);
 }