opensearch-dev / opensearch
PHP Client for Aliyun Opensearch
v3.3.0
2019-07-25 00:57 UTC
Requires
- php: >=7.0
- ext-curl: *
Suggests
- ext-swoole: ^4.0
This package is auto-updated.
Last update: 2025-03-25 13:50:40 UTC
README
PHP Client for Aliyun Opensearch
How to install
composer require opensearch-dev/opensearch
Work with Swoole
go(function() { $coClient = new OpenSearch\Client\OpenSearchClient('some-key', 'some-secret', 'http://opensearch-cn-hangzhou.aliyuncs.com'); $coClient->setHttpHandler(new OpenSearch\Client\Handler\SwooleHttpHandler()); // 更换请求处理器 $resultObj = $coClient->get('/apps'); $resultJSON = $resultObj->result; $result = json_decode($resultJSON, true); fprintf(STDOUT, "name=%s" . PHP_EOL, $result['result']['name']); });