コード例 #1
0
ファイル: Response.php プロジェクト: royalwang/Pyramid
 /**
  * 发送content
  */
 public function send($callback = null)
 {
     if ($callback && is_callable($callback)) {
         $callback($this);
     }
     if (is_array($this->content) || is_object($this->content)) {
         $output = '<xml>' . self::buildXML((array) $this->content) . '</xml>';
     } else {
         $output = (string) $this->content;
     }
     if ($this->encrypted) {
         try {
             $prpcrypt = new Prpcrypt($this->wechat->getConfig('aeskey'));
             $output = $prpcrypt->encrypt($output, $this->wechat->getConfig('appid'));
             $output = $this->encrypt($output);
         } catch (Exception $e) {
         }
     }
     echo $output;
     return $this;
 }