mrferos/zulip-php
最新稳定版本:2.0.0-beta
Composer 安装命令:
composer require mrferos/zulip-php
包简介
PHP Zuilip Client
README 文档
README
I am working on a V2 of the client that is more up to date and is actually tested to work, please see the v2 branch for updates
Have been playing around with Zulip and noticed there was no PHP client... So I made one!
Installation
Using composer!
composer require mrferos/zulip-php:^0.1.0
Usage:
Using the client is simple, instantiate it with the URL to your Zulip instance and pass the default authentication object (on a per request basis you can specify different authentication in case you need/want to send messages as different users per requests).
Example:
<?php require_once __DIR__ . '/vendor/autoload.php'; $client = new \Zulip\Client('http://localhost:9991'); $client->setDefaultAuthentication(new \Zulip\Authentication('feedback@zulip.com', '7Rp5bNRVz1dSuDz4HhANaxlpNDcYb6GQ')); $client->sendMessage([ 'to' => 'Denmark', 'content' => 'content', 'type' => \Zulip\Request\MessageParameters::TYPE_STREAM, 'subject' => 'subject' ]); // or.. (this is what happens under the code if you pass an array) $parameters = new \Zulip\Request\MessageParameters(); $parameters->setContent('Content of message'); $parameters->setTo('Denmark'); $parameters->setType(\Zulip\Request\MessageParameters::TYPE_STREAM); $parameters->setSubject('This is the subject'); $client->sendMessage($parameters);
TODO:
- Write tests
- Implement the rest of the API
- More documentation!
统计信息
- 总下载量: 10.71k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-27