酒店预订平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.3 KiB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <img align="right" width="100" src="https://user-images.githubusercontent.com/1472352/49656357-1e874080-fa78-11e8-80ea-69e2103345cf.png" alt="EasyWeChat Logo"/>
  2. <h1 align="left"><a href="https://www.easywechat.com">EasyWeChat</a></h1>
  3. 📦 It is probably the best SDK in the world for developing Wechat App.
  4. [![Test Status](https://github.com/overtrue/wechat/workflows/Test/badge.svg)](https://github.com/overtrue/wechat/actions)
  5. [![Lint Status](https://github.com/overtrue/wechat/workflows/Lint/badge.svg)](https://github.com/overtrue/wechat/actions)
  6. [![Latest Stable Version](https://poser.pugx.org/overtrue/wechat/v/stable.svg)](https://packagist.org/packages/overtrue/wechat)
  7. [![Latest Unstable Version](https://poser.pugx.org/overtrue/wechat/v/unstable.svg)](https://packagist.org/packages/overtrue/wechat)
  8. [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/overtrue/wechat/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/overtrue/wechat/?branch=master)
  9. [![Code Coverage](https://scrutinizer-ci.com/g/overtrue/wechat/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/overtrue/wechat/?branch=master)
  10. [![Total Downloads](https://poser.pugx.org/overtrue/wechat/downloads)](https://packagist.org/packages/overtrue/wechat)
  11. [![License](https://poser.pugx.org/overtrue/wechat/license)](https://packagist.org/packages/overtrue/wechat)
  12. ## Requirement
  13. 1. PHP >= 7.1
  14. 2. **[Composer](https://getcomposer.org/)**
  15. 3. openssl 拓展
  16. 4. fileinfo 拓展(素材管理模块需要用到)
  17. ## Installation
  18. ```shell
  19. $ composer require "overtrue/wechat:^4.2" -vvv
  20. ```
  21. ## Usage
  22. 基本使用(以服务端为例):
  23. ```php
  24. <?php
  25. use EasyWeChat\Factory;
  26. $options = [
  27. 'app_id' => 'wx3cf0f39249eb0exxx',
  28. 'secret' => 'f1c242f4f28f735d4687abb469072xxx',
  29. 'token' => 'easywechat',
  30. 'log' => [
  31. 'level' => 'debug',
  32. 'file' => '/tmp/easywechat.log',
  33. ],
  34. // ...
  35. ];
  36. $app = Factory::officialAccount($options);
  37. $server = $app->server;
  38. $user = $app->user;
  39. $server->push(function($message) use ($user) {
  40. $fromUser = $user->get($message['FromUserName']);
  41. return "{$fromUser->nickname} 您好!欢迎关注 overtrue!";
  42. });
  43. $server->serve()->send();
  44. ```
  45. 更多请参考 [https://www.easywechat.com/](https://www.easywechat.com/)。
  46. ## Documentation
  47. [官网](https://www.easywechat.com) · [教程](https://www.easywechat.com/tutorials) · [讨论](https://yike.io/) · [微信公众平台](https://mp.weixin.qq.com/wiki) · [WeChat Official](http://admin.wechat.com/wiki)
  48. ## Integration
  49. [Laravel 5 拓展包: overtrue/laravel-wechat](https://github.com/overtrue/laravel-wechat)
  50. ## Contributors
  51. This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
  52. <a href="https://github.com/overtrue/wechat/graphs/contributors"><img src="https://opencollective.com/wechat/contributors.svg?width=890" /></a>
  53. ## PHP 扩展包开发
  54. > 想知道如何从零开始构建 PHP 扩展包?
  55. >
  56. > 请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— [《PHP 扩展包实战教程 - 从入门到发布》](https://learnku.com/courses/creating-package)
  57. ## License
  58. MIT
  59. [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fovertrue%2Fwechat.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fovertrue%2Fwechat?ref=badge_large)