Skip to content

A PHP extension for interfacing with Apache ZooKeeper

License

Notifications You must be signed in to change notification settings

lukanetconsult/php-zookeeper

This branch is 29 commits behind php-zookeeper/php-zookeeper:master.

Folders and files

NameName
Last commit message
Last commit date
Jun 19, 2021
Jan 14, 2022
Jun 2, 2018
Mar 7, 2022
Jun 27, 2019
Dec 21, 2018
Mar 7, 2022
Oct 15, 2009
Jan 14, 2022
Jun 6, 2010
Feb 24, 2021
Nov 24, 2020
Mar 7, 2022
Jan 14, 2022
Jun 25, 2021
Jun 25, 2021
Jun 25, 2021
Jan 24, 2019
Jun 25, 2021
Jun 25, 2021
Jun 25, 2021
Jun 25, 2021
Nov 24, 2020
Jul 4, 2018
Jun 6, 2010
Jun 25, 2021
Jan 13, 2012
Jan 30, 2019
Jun 2, 2018
Nov 24, 2020
Jan 13, 2012
Jul 7, 2019

Repository files navigation

PHP ZooKeeper Extension

Build Status Coveralls

This extension uses libzookeeper library to provide API for communicating with ZooKeeper service.

ZooKeeper is an Apache project that enables centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.

Requirements

Install

1.Compile ZooKeeper C Binding

$ ./configure --prefix=/path/to/zookeeper-c-binding
$ make
$ sudo make install

As of ZooKeeper 3.5.0, after unpacking source tarball, the following command should be executed before above-metioned steps:

$ autoreconf -if

As of ZooKeeper 3.5.9, the following command should be executed before autoreconf -if:

$ ant compile_jute

As 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:

$ cd apache-zookeeper-3.5.9
$ cp build.xml ivy* ../apache-zookeeper-3.6.2

2.Compile PHP ZooKeeper Extension

$ phpize
$ ./configure --with-libzookeeper-dir=/path/to/zookeeper-c-binding
$ make
$ sudo make install

Examples

<?php
$zc = new Zookeeper();
$zc->connect('localhost:2181');
var_dump($zc->get('/zookeeper'));
?>

Working with other extensions

1.Swoole

Swoole\Async::set([
    'enable_signalfd' => false, // See: https://github.com/swoole/swoole-src/issues/302
]);

$zk = new Zookeeper('localhost:2181');

Swoole\Process::signal(SIGTERM, function() {
        echo "TERM" . PHP_EOL;
        Swoole\Event::exit();
    });
Swoole\Event::wait();

For Developers

Branches

  • master: Main branch.
  • 0.5.x: The last branch which still supports PHP 5.x.

Resources

About

A PHP extension for interfacing with Apache ZooKeeper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 55.6%
  • PHP 33.5%
  • Shell 4.1%
  • Dockerfile 3.2%
  • M4 2.8%
  • HTML 0.5%
  • Makefile 0.3%