kpacha / suricate-config
Resilent configuration system based on zookeeper (and suricate!)
Requires
- php: >=5.3.3
- kpacha/config: ~0.1
- kpacha/suricate-php-sdk: ~1.0
Requires (Dev)
- phpunit/phpunit: ~4.6
This package is not auto-updated.
Last update: 2024-12-17 01:58:02 UTC
README
A simple config module with an integrated suricate service discovery system for php
#Requirements
- git
- PHP >=5.3.3
- kpacha/config (so check its dependencies!)
- kpacha/suricate-php-sdk (so check its dependencies!)
#Installation
##Standalone
##As a library (recomended)
Include the kpacha/suricate-config
package in your compose.json with all the dependencies of your project
"require":{
"kpacha/suricate-config": "~0.1"
}
###Git installation
Clone the repo
$ git clone https://github.com/kpacha/suricate-config.git
Install the php dependencies
$ cd suricate-config
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
###Composer installation
Create a project with composer
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project kpacha/suricate-config [directory]
Remeber to set the [directory] parameter or composer will create the project in your current path.
#Config files
Just set the value \\Kpacha\\Suricate\\Config\\ServiceManager
to your service-manager
config param and fix the url of your suricate server.
Visit kpacha/config for more info.
#Usage
##Config module
This package is a transparent extension for kpacha/config module
##Console
The kpacha/suricate-php-sdk
package comes with a simple client and several console commands bundled in a simple app. Check the project web for more info.
The kpacha/suricate-config
packages extends the kpacha/suricate-php-sdk
and adds the Update
command from kpacha/config
in order to expose a clean CLI so you could add a cron to:
- Send a periodic heartbeat to notify the suricate server the node is up. Check the inline help for the command
$ bin/suricate-config s:h --help
- Update the service info querying the suricate server for the services listed in the
service-name
area of yoursuricate_services.yml
file with$ bin/suricate-config c:u /path/to/config/dir
Run the suricate-config
script to trigger any console command.
Visit the suricate-php-sdk project for more info.