PHP code example of busyphp / wechat-public

1. Go to this page and download the library: Download busyphp/wechat-public library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

busyphp / wechat-public example snippets



return [
    // 公众号配置
    'public' => [
        // 公众号 App Id
        'app_id'           => '',
    
    
        // 公众号 App Secret
        'app_secret'       => '',
    
    
        // 公众号 令牌(Token)
        'token'            => '',
    
    
        // todo 暂无意义
        // 消息加解密密钥 (EncodingAESKey)
        'encoding_aes_key' => '',
        
        
        // 监听事件
        // 请参考对于类中的描述绑定自己的Event即可
        'listen'           => [
            //AuthEvent::class            => '',
            //ClickEvent::class           => '',
            //FollowEvent::class          => '',
            //LocationEvent::class        => '',
            //NamingEvent::class          => '',
            //PicEvent::class             => '',
            //RenewEvent::class           => '',
            //ScanCodeEvent::class        => '',
            //ScanEvent::class            => '',
            //TemplateMessageEvent::class => '',
            //ViewEvent::class            => '',
            //ImageMessageEvent::class    => '',
            //LinkMessageEvent::class     => '',
            //LocationMessageEvent::class => '',
            //TextMessageEvent::class     => '',
            //VideoMessageEvent::class    => '',
            //VoiceMessageEvent::class    => '',
        ]
    ],
];