Skip to content

andhm/localq-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

localq-php

localq for php (client) 作为客户端,实现localq-server协议,并向localq-server推送数据

Requirement

php5.4+

Installation

$/path/to/phpize
$./configure --with-php-config=/path/to/php-config
$make && make install

Usage

配置php.ini
[localq]
localq.sock_path=/path/to/localq-sock-unix-file

$objLocalq = new Localq();
$data = array('hello');
$class = 'UserCls'; // 数据处理的类
$method = 'UserMtd'; // 数据处理的方法
if (-1 == $objLocalq->push(json_encode($data), $method, $class)) {
  // 出现错误 -1
  var_dump($objLocalq->getError());
}
处理方法示例
class UserCls {
  public function UserMtd($data) {
    // 处理$data
    var_dump($data);
    return 0; // 0 succ; -1 fail
  }
}

About

localq for php (client)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published