hyperf/docs/zh-tw/etcd.md
2021-02-24 14:17:31 +08:00

408 B

ETCD

安裝

composer require hyperf/etcd

新增配置檔案 etcd.php

<?php
return [
    'uri' => 'http://192.168.1.200:2379',
    'version' => 'v3beta',
    'options' => [
        'timeout' => 10,
    ],
];

使用

<?php

use Hyperf\Utils\ApplicationContext;
use Hyperf\Etcd\KVInterface;

$client = ApplicationContext::getContainer()->get(KVInterface::class);