GithubHelp home page GithubHelp logo

falvarez / php-zookeeper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from php-zookeeper/php-zookeeper

0.0 0.0 0.0 345 KB

A PHP extension for interfacing with Apache ZooKeeper

License: Other

Shell 4.10% C 55.69% PHP 33.42% Makefile 0.26% HTML 0.46% M4 2.83% Dockerfile 3.24%

php-zookeeper's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.