• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H03-May-2022-266138

CREDITSH A D25-Jun-202126 32

ChangeLogH A D25-Jun-20213.4 KiB145114

LICENSEH A D25-Jun-20213.1 KiB6955

README.markdownH A D25-Jun-20212.5 KiB11570

config.m4H A D25-Jun-20214.8 KiB131108

php_zookeeper.cH A D25-Jun-202137.1 KiB1,5651,099

php_zookeeper.hH A D25-Jun-20212.8 KiB10864

php_zookeeper_callback.cH A D25-Jun-20211.8 KiB5331

php_zookeeper_callback.hH A D25-Jun-20211.7 KiB5028

php_zookeeper_class.hH A D25-Jun-20211.3 KiB3312

php_zookeeper_config_class.cH A D25-Jun-20218.4 KiB295202

php_zookeeper_config_class.hH A D25-Jun-20211.2 KiB266

php_zookeeper_exceptions.cH A D25-Jun-20213.8 KiB11580

php_zookeeper_exceptions.hH A D25-Jun-20211.5 KiB358

php_zookeeper_log.cH A D25-Jun-20212.1 KiB4827

php_zookeeper_log.hH A D25-Jun-20211.2 KiB257

php_zookeeper_private.hH A D25-Jun-20211.2 KiB234

php_zookeeper_session.cH A D25-Jun-20218.8 KiB350234

php_zookeeper_session.hH A D25-Jun-20211.5 KiB4412

php_zookeeper_stat.cH A D25-Jun-20212 KiB4425

php_zookeeper_stat.hH A D25-Jun-20211.1 KiB256

zoo_lock.cH A D25-Jun-202113.5 KiB433342

zoo_lock.hH A D25-Jun-20214.9 KiB16938

zookeeper-api.phpH A D25-Jun-20219.5 KiB403133

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