weesee/yii2-etcd
Composer 安装命令:
composer require weesee/yii2-etcd
包简介
Yii2 extension to work with ETCD key-value store from CoreOS
README 文档
README
Yii2 extension to access Etcd service.
Etcd is a key-value store for distributed systems.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist weesee/yii2-etcd "*"
or add
"weesee/yii2-etcd": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by:
use weesee\etcd\Etcd; // setup connection to Etcd // setting root means all key are appended to this path $etcd = new Etcd([ 'etcdUrl' => 'http://127.0.0.1:2379', 'root'=>"/yii2-etcd-test/" ]); // write key value pairs to etcd if ($etcd->exists("name")) $etcd->update("name","value"); // updates "/yii2-etcd-test/name" else $etcd->set("name","value"); // sets "/yii2-etcd-test/name" // remove key $etcd->removeKey("name"); // removes "/yii2-etcd-test/name" // get keys with values in current directory "/yii2-etcd-test" // as ArrayDataProvider. Simple to use for GidViews,... $dataProvider = $etcd->getKeyValueAsDataProvider();
Credits
Thanks for your great job which this Yii2-extension is build on:
Author / Licence
WeeSee weesee@web.de
GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007
统计信息
- 总下载量: 390
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2018-02-24