rooyekhat/igap-php-client

此软件包已被弃用,不再维护。未建议替代包。

iGap信使的PHP客户端

1.0.4 2018-06-30 07:07 UTC

This package is not auto-updated.

Last update: 2021-10-09 23:56:39 UTC


README

PRs Welcome GitHub top language GitHub repo size in bytes GNU LESSER GENERAL PUBLIC LICENSE

官方iGap PHP客户端

安装

推荐通过 Composer 安装 iGap-PHP-Client。

# Install Composer
curl -sS https://getcomposer.org/installer | php

接下来,运行Composer命令安装iGap-PHP-Client的最新稳定版本

composer require rooyekhat/igap-php-client

安装后,您需要引入Composer的自动加载器

require 'vendor/autoload.php';

然后您可以使用Composer更新iGap-PHP-Client

composer update

需要 protobuf 模块,请参考 https://github.com/google/protobuf/tree/master/php

快速入门示例

安装完成后,您可以使用以下代码发送一些请求

$loop = React\EventLoop\Factory::create();
$connector = new React\Socket\Connector($loop, [
    'dns' => '8.8.8.8',
    'timeout' => 10
]);

iGap\Api::init($loop, $connector);

$userRegister = new \Proto\UserRegister();
$userRegister->setCountryCode('IR');
$userRegister->setPhoneNumber('912xxxxxxx');

iGap\Api::getInstance()->invoke(
    iGap\Api::ACTION_USER_REGISTER,
    $userRegister
);

$loop->run();

另请参阅 示例

API文档

iGap API手册: https://github.com/RooyeKhat-Media/iGap-API

协议缓冲文件: https://github.com/RooyeKhat-Media/iGap-API/tree/master/app/assets/proto

合作伙伴

RooyeKhat Media 成立于2015年,旨在基于现代技术,在互联网和网络的基础上创建具有沟通和信息交流的平台。我们专注于设计、编程以及移动和桌面设备上的沟通和媒体软件的支持。

许可证

iGap-PHP-Client遵循GNU Lesser General Public License

GNU LESSER GENERAL PUBLIC LICENSE - Version 3