承接 mailmug/zentropy-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mailmug/zentropy-php

最新稳定版本:v1.1.3

Composer 安装命令:

composer require mailmug/zentropy-php

包简介

PHP client for Zentropy server

README 文档

README

Latest Stable Version

A simple and professional PHP client for Zentropy. Supports TCP connections with authentication and Unix socket connections.

Features

  • Connect to Zentropy server over TCP or Unix socket.
  • Optional password authentication for TCP connections.
  • Common commands: SET, GET, DELETE, EXISTS, PING.
  • Easy to integrate in any PHP project, including Laravel.
  • Minimal dependencies, PSR-4 autoloading.

Installation

Use Composer to install:

composer require mailmug/zentropy-php

Usage

TCP Connection (with optional password)

<?php

require 'vendor/autoload.php';

use Zentropy\Client;

$client = Client::tcp('127.0.0.1', 6383, 'pass@123');

$client->set('foo', 'bar');
echo $client->get('foo'); // Outputs: bar
$client->close();

Unix Socket Connection

<?php

require 'vendor/autoload.php';

use Zentropy\Client;

$client = Client::unixSocket('/tmp/zentropy.sock');

$client->set('foo', 'bar');
echo $client->get('foo'); // Outputs: bar
$client->close();

API Reference

Method Description
Client::tcp($host, $port, $password) Create a TCP client with optional password.
Client::unixSocket($path) Create a client using a Unix socket.
set(string $key, string $value) Set a key-value pair.
get(string $key) Get the value of a key. Returns null if key doesn't exist.
delete(string $key) Delete a key. Returns true if successful.
exists(string $key) Check if a key exists.
ping() Ping the server. Returns true if alive.
close() Close the connection.
auth(string $password) Authenticate TCP connection (internal for TCP only).

Running Examples

Contributing

  1. Fork the repository.

  2. Run composer install.

  3. Add tests in tests/ and examples in examples/.

  4. Submit a pull request.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-24