zookeeper / laravel-zookeeper
zookeeper for laravel
Installs: 95
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/zookeeper/laravel-zookeeper
Requires
- php: >=7.0
This package is auto-updated.
Last update: 2025-12-08 16:06:38 UTC
README
zookeeper for laravel^5.6.*
Installation
composer require zookeeper/laravel-zookeeper
If using Laravel, add the Service Provider to the providers array in config/app.php:
[
'providers' => [
Ly\Zookeeper\ZookeeperServiceProvider::class,
],
]
If using Lumen, appending the following line to bootstrap/app.php:
$app->register(Ly\Zookeeper\ZookeeperServiceProvider::class);
If you need use Laravel Facades, add the aliases array in config/app.php:
[
'aliases' => [
'Zk' => Ly\Zookeeper\Facades\Zk::class,
],
]
Using
//example
<?php
use Ly\Zookeeper\Facades\Zk;
class TesxtController extends controller {
public function test ()
{
$nodeValue = ZK::getNodeData('usercenter/userhost');
}
}
Version 1.1.0
-
zk_config add cache path
cache => storage_path('zookeeper') -
add the Commands
| Command | Description |
|---|---|
| start | Start Zookeeper Server, watch the node and nodeValue |
| cache | Start Zookeeper, Cache the node and nodeValue to the file |
Now,you can run the following command to start Zookeeper
$ php artisan zookeeper:server start
$ php artisan zookeeper:server cache
Notice: The zookeeper data cached storage/zookeeper/config.php;