Download the PHP package qingze-lab/openim-sdk-php without Composer
On this page you can find all versions of the php package qingze-lab/openim-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download qingze-lab/openim-sdk-php
More information about qingze-lab/openim-sdk-php
Files in qingze-lab/openim-sdk-php
Download qingze-lab/openim-sdk-php
More information about qingze-lab/openim-sdk-php
Files in qingze-lab/openim-sdk-php
Vendor qingze-lab
Package openim-sdk-php
Short Description OpenIM REST API PHP SDK with token management, retryable HTTP, and domain services.
License MIT
Homepage https://github.com/qingze-lab/openim-sdk-php
Package openim-sdk-php
Short Description OpenIM REST API PHP SDK with token management, retryable HTTP, and domain services.
License MIT
Homepage https://github.com/qingze-lab/openim-sdk-php
Please rate this library. Is it a good library?
Informations about the package openim-sdk-php
OpenIM PHP SDK
一个干净易用的 OpenIM REST API PHP SDK,提供 Token 管理、可靠的 HTTP 调用与常用领域服务封装(用户、群组、消息等)。
特性
- 轻量封装 OpenIM REST API,开箱即用
- 自动注入
token与operationID请求头 - 支持可配置的 HTTP 重试与超时
- 与 PSR-16 缓存接口兼容,便于替换 Redis/Memcached
- 纯 PHP,无侵入,适合后端服务或脚本场景
环境要求
- PHP 8.2+
- Composer
- 可访问的 OpenIM Server(默认
http://localhost:10002)
安装
composer require qingze-lab/openim-sdk-php
快速开始(使用 OpenIMClient 简化初始化)
常用用法
-
获取用户 Token
-
更新用户信息
-
发送消息
-
内容类与便捷方法发送消息
- 创建群组
Redis 缓存示例
配置说明
OpenIMConfig构造参数:baseUrlOpenIM API 地址adminUserId管理员用户 ID(如imAdmin)adminSecret管理员鉴权凭证timeout请求超时(秒),默认 5.0connectTimeout连接超时(秒),默认 2.0retryMaxAttempts最大重试次数,默认 3retryDelayMs重试间隔毫秒,默认 200
API 路径前缀策略
- 默认自动模式(
auto):当baseUrl为端口/IP/localhost(如http://localhost:10002、http://127.0.0.1:10002),业务路径不加/api;当为域名(如https://im.example.com),业务路径自动加/api。 - 显式覆盖:
- 始终加:
$config->setApiPrefixMode('always') - 始终不加:
$config->setApiPrefixMode('never') - 自定义前缀值:
$config->setApiPrefixValue('/v1')
- 始终加:
测试
composer installvendor/bin/phpunit
示例
- 参见
examples/basic_usage.php与examples/redis_cache.php
许可证
- MIT
All versions of openim-sdk-php with dependencies
PHP Build Version
Package Version
The package qingze-lab/openim-sdk-php contains the following files
Loading the files please wait ...