Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
examples/ | H | 03-May-2022 | - | 266 | 138 | |
CREDITS | H A D | 25-Jun-2021 | 26 | 3 | 2 | |
ChangeLog | H A D | 25-Jun-2021 | 3.4 KiB | 145 | 114 | |
LICENSE | H A D | 25-Jun-2021 | 3.1 KiB | 69 | 55 | |
README.markdown | H A D | 25-Jun-2021 | 2.5 KiB | 115 | 70 | |
config.m4 | H A D | 25-Jun-2021 | 4.8 KiB | 131 | 108 | |
php_zookeeper.c | H A D | 25-Jun-2021 | 37.1 KiB | 1,565 | 1,099 | |
php_zookeeper.h | H A D | 25-Jun-2021 | 2.8 KiB | 108 | 64 | |
php_zookeeper_callback.c | H A D | 25-Jun-2021 | 1.8 KiB | 53 | 31 | |
php_zookeeper_callback.h | H A D | 25-Jun-2021 | 1.7 KiB | 50 | 28 | |
php_zookeeper_class.h | H A D | 25-Jun-2021 | 1.3 KiB | 33 | 12 | |
php_zookeeper_config_class.c | H A D | 25-Jun-2021 | 8.4 KiB | 295 | 202 | |
php_zookeeper_config_class.h | H A D | 25-Jun-2021 | 1.2 KiB | 26 | 6 | |
php_zookeeper_exceptions.c | H A D | 25-Jun-2021 | 3.8 KiB | 115 | 80 | |
php_zookeeper_exceptions.h | H A D | 25-Jun-2021 | 1.5 KiB | 35 | 8 | |
php_zookeeper_log.c | H A D | 25-Jun-2021 | 2.1 KiB | 48 | 27 | |
php_zookeeper_log.h | H A D | 25-Jun-2021 | 1.2 KiB | 25 | 7 | |
php_zookeeper_private.h | H A D | 25-Jun-2021 | 1.2 KiB | 23 | 4 | |
php_zookeeper_session.c | H A D | 25-Jun-2021 | 8.8 KiB | 350 | 234 | |
php_zookeeper_session.h | H A D | 25-Jun-2021 | 1.5 KiB | 44 | 12 | |
php_zookeeper_stat.c | H A D | 25-Jun-2021 | 2 KiB | 44 | 25 | |
php_zookeeper_stat.h | H A D | 25-Jun-2021 | 1.1 KiB | 25 | 6 | |
zoo_lock.c | H A D | 25-Jun-2021 | 13.5 KiB | 433 | 342 | |
zoo_lock.h | H A D | 25-Jun-2021 | 4.9 KiB | 169 | 38 | |
zookeeper-api.php | H A D | 25-Jun-2021 | 9.5 KiB | 403 | 133 |
README.markdown
1# PHP ZooKeeper Extension 2 3[![Build Status](https://img.shields.io/travis/php-zookeeper/php-zookeeper/master.svg?style=flat-square)](https://travis-ci.org/php-zookeeper/php-zookeeper) 4[![Coveralls](https://img.shields.io/coveralls/php-zookeeper/php-zookeeper.svg?style=flat-square)](https://coveralls.io/r/php-zookeeper/php-zookeeper?branch=master) 5 6This extension uses libzookeeper library to provide API for communicating with 7ZooKeeper service. 8 9ZooKeeper is an Apache project that enables centralized service for maintaining 10configuration information, naming, providing distributed synchronization, and 11providing group services. 12 13 14 15## Requirements 16 17- [ZooKeeper C Binding](https://zookeeper.apache.org/) (>= 3.4) 18- [PHP](http://www.php.net/) (>= 7.0) 19 20 21 22## Install 23 24### 1.Compile ZooKeeper C Binding 25 26```shell 27$ ./configure --prefix=/path/to/zookeeper-c-binding 28$ make 29$ sudo make install 30``` 31 32As of ZooKeeper 3.5.0, after unpacking source tarball, the following command should be executed before above-metioned steps: 33 34```shell 35$ autoreconf -if 36``` 37 38As of ZooKeeper 3.5.9, the following command should be executed before `autoreconf -if`: 39 40```shell 41$ ant compile_jute 42``` 43 44As of ZooKeeper 3.6.0, `ant` will fail because of missing `build.xml`. That file and two other files can be found in source tarball of `3.5.9`: 45 46```shell 47$ cd apache-zookeeper-3.5.9 48$ cp build.xml ivy* ../apache-zookeeper-3.6.2 49``` 50 51 52 53### 2.Compile PHP ZooKeeper Extension 54 55```shell 56$ phpize 57$ ./configure --with-libzookeeper-dir=/path/to/zookeeper-c-binding 58$ make 59$ sudo make install 60``` 61 62 63 64## Examples 65 66```php 67<?php 68$zc = new Zookeeper(); 69$zc->connect('localhost:2181'); 70var_dump($zc->get('/zookeeper')); 71?> 72``` 73 74 75 76## Working with other extensions 77 78### 1.Swoole 79 80```php 81Swoole\Async::set([ 82 'enable_signalfd' => false, // See: https://github.com/swoole/swoole-src/issues/302 83]); 84 85$zk = new Zookeeper('localhost:2181'); 86 87Swoole\Process::signal(SIGTERM, function() { 88 echo "TERM" . PHP_EOL; 89 Swoole\Event::exit(); 90 }); 91Swoole\Event::wait(); 92``` 93 94 95 96## For Developers 97 98* Install [EditorConfig](https://editorconfig.org/) to your IDE. 99 100### Branches 101 102* master: Main branch. 103* 0.5.x: The last branch which still supports PHP 5.x. 104 105 106 107## Resources 108 109- [Document](https://secure.php.net/manual/en/book.zookeeper.php) 110- [PECL Page](https://pecl.php.net/package/zookeeper) 111- [Zookeeper](https://zookeeper.apache.org/) 112- [PHP Zookeeper Recipes](https://github.com/Gutza/php-zookeeper-recipes) 113- [PHP Zookeeper Admin](https://github.com/Timandes/zookeeper-admin) 114 115