Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在命名空间 EasyWeChat\Foundation下增加 BootstrapInterface 接口,实现 bootstrap($app),方法,在程序初始化阶段,提供了一个注入点,使第三方插件,或者是消息处理程序能自动注射到应用程序实例中,从而自动响应微信回调等各种接口的消息。
示例插件在 https://github.com/xutl/wechat-test
其中关键点
composer.json
文件的 type 标记包类型为wechat-extension
,此时https://github.com/xutl/wechat-composer
插件会自动在vendor\overtrue\extensions.php
生成一个数组,标记该插件的基本信息。并且在'composer.json' 的标记在程序启动阶段注入以上类的实例,从而实现了插件机制。
其中'xutl/wechat-composer',移植自 自yii2的 composer插件,版权归原作者所有,开源协议是 BSD-3-Clause.
如需使用需要在配置中增加一个vendor设置。
如果不增加
vendor
字段设置,将不生效。