Skip to content

Commit e1dfde7

Browse files
author
ayhome
committed
重新提交
1 parent 326b288 commit e1dfde7

File tree

11 files changed

+89
-214
lines changed

11 files changed

+89
-214
lines changed

.DS_Store

6 KB
Binary file not shown.

Exception/Base.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

Exception/err.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

KafKa.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

Message.php

Lines changed: 0 additions & 58 deletions
This file was deleted.

Producer.php

Lines changed: 0 additions & 49 deletions
This file was deleted.

composer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "ayhome/kafka",
3+
"description": "kafka-php-lite",
4+
"type": "library",
5+
"authors": [
6+
{
7+
"name": "ayhome",
8+
"email": "ayhome@foxmail.com"
9+
}
10+
],
11+
"require": {}
12+
}

Consumer.php renamed to src/Consumer.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
<?php
2-
// Copyright 2016 The See-KafKa Authors. All rights reserved.
3-
//
4-
// Licensed under the Apache License, Version 2.0 (the "License"): you may
5-
// not use this file except in compliance with the License. You may obtain
6-
// a copy of the License at
7-
//
8-
// http://www.apache.org/licenses/LICENSE-2.0
9-
//
10-
// Unless required by applicable law or agreed to in writing, software
11-
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12-
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13-
// License for the specific language governing permissions and limitations
14-
// under the License.
2+
namespace ayhome\KafKa;
153

164
// 通过offset和group来获取消息(必须设置group)
175
const KAFKA_OFFSET_STORED = RD_KAFKA_OFFSET_STORED;
@@ -25,7 +13,7 @@
2513
* KafKa-Consumer类
2614
* @author : @喵了个咪<wenzhenxi@vip.qq.com>
2715
*/
28-
class KafKa_Consumer {
16+
class Consumer {
2917

3018
protected $topic = null;
3119

Lite.php renamed to src/KafKa.php

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,10 @@
11
<?php
2-
// Copyright 2016 The See-KafKa Authors. All rights reserved.
3-
//
4-
// Licensed under the Apache License, Version 2.0 (the "License"): you may
5-
// not use this file except in compliance with the License. You may obtain
6-
// a copy of the License at
7-
//
8-
// http://www.apache.org/licenses/LICENSE-2.0
9-
//
10-
// Unless required by applicable law or agreed to in writing, software
11-
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12-
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13-
// License for the specific language governing permissions and limitations
14-
// under the License.
15-
16-
/**
17-
* KafKa拓展类
18-
* @author : @喵了个咪<wenzhenxi@vip.qq.com>
19-
* 依赖PHP-C拓展:https://github.com/arnaud-lb/php-rdkafka
20-
* 依赖服务底层:https://github.com/edenhill/librdkafka
21-
* setKafkaConf和setTopicConf配置说明地址:
22-
* https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
23-
*/
2+
namespace ayhome\KafKa;
243

254
// KafKa分区自动随机分配
265
const KAFKA_PARTITION_UA = RD_KAFKA_PARTITION_UA;
276

28-
class KafKa_Lite {
7+
class KafKa {
298

309
// KafKaHostList
3110
protected $BrokerList = array();

src/Message.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
namespace ayhome\KafKa;
3+
class Message
4+
{
5+
/**
6+
* @var int
7+
*/
8+
public $err;
9+
10+
/**
11+
* @var string
12+
*/
13+
public $topic_name;
14+
15+
/**
16+
* @var int
17+
*/
18+
public $partition;
19+
20+
/**
21+
* @var string
22+
*/
23+
public $payload;
24+
25+
/**
26+
* @var string
27+
*/
28+
public $key;
29+
30+
/**
31+
* @var int
32+
*/
33+
public $offset;
34+
35+
/**
36+
* @return string
37+
*/
38+
public function errstr()
39+
{
40+
}
41+
}

0 commit comments

Comments
 (0)