encrypt() public method

对明文进行加密
public encrypt ( string $text, $appid ) : string
$text string 需要加密的明文
return string 加密后的密文
     */
    public function __construct($config)
    {
        $this->appId = $config['appId'];
        $this->token = $config['token'];
        $this->encodingAESKey = isset($config['encodingAESKey']) && !empty($config['encodingAESKey']) ? $config['encodingAESKey'] : FALSE;
    }
    /**
	 * 微信消息处理主入口
	 * - 自动处理服务器配置验证
	 *
	 * @return string
	 */
    public function serve()
    {
        // 微信消息GET参数处理
        $this->checkParams();
        // 处理微信URL接入
        $this->accessAuth();
        // 获取微信消息
        return $this->getMessage();
    }
    /**
     * 被动回复微信消息
     *
     * @param $msg array
     *        
     */
    public function reply($msg)
    {
        // 获取消息类型
        $msg_type = '';
        if (gettype($msg) == 'string') {
            $msg_type = 'text_simple';
        } elseif (gettype($msg) == 'array') {
            $msg_type = $msg['type'];
        }
        $xml = '';
        switch ($msg_type) {
            /**
    		 * 1.1 回复文本消息(简洁输入)
    		 *
    		 * Examples:
             * ```
    		 * $wechat->reply('hello world!');
    		 * ```
    		 */
            case 'text_simple':
                $xml = sprintf('<xml>
						<ToUserName><![CDATA[%s]]></ToUserName>
						<FromUserName><![CDATA[%s]]></FromUserName>
						<CreateTime>%s</CreateTime>
						<MsgType><![CDATA[text]]></MsgType>
						<Content><![CDATA[%s]]></Content>
						</xml>', $this->message->FromUserName, $this->message->ToUserName, time(), $msg);
                break;
                /**
    		 * 1.2 回复文本消息
    		 *
    		 * Examples:
             * ```
    		 * $wechat->reply(array(
			 *	'type' => 'text',
			 *	'content' => '嘿嘿,呵呵~~'
			 * ));
			 * ```
    		 */
            /**
    		 * 1.2 回复文本消息
    		 *
    		 * Examples:
             * ```
    		 * $wechat->reply(array(
			 *	'type' => 'text',
			 *	'content' => '嘿嘿,呵呵~~'
			 * ));
			 * ```
    		 */
            case 'text':
                $xml = sprintf('<xml>
						<ToUserName><![CDATA[%s]]></ToUserName>
						<FromUserName><![CDATA[%s]]></FromUserName>
						<CreateTime>%s</CreateTime>
						<MsgType><![CDATA[text]]></MsgType>
						<Content><![CDATA[%s]]></Content>
						</xml>', $this->message->FromUserName, $this->message->ToUserName, time(), $msg['content']);
                break;
                /**
    		 * 2 回复图片消息
    		 *
    		 * Examples:
             * ```
    		 * $wechat->reply(array(
	 		 * 	'type' => 'image',