Skip to content

Commit 87b311a

Browse files
lintygit-hulk
linty
authored andcommitted
MOD: cleanup for open source
1 parent 0eaa464 commit 87b311a

File tree

5 files changed

+1608
-0
lines changed

5 files changed

+1608
-0
lines changed

Example.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
require 'vendor/autoload.php';
4+
5+
use Kaproxy\Client;
6+
7+
$addr = "http://127.0.0.1:8080";
8+
$token = "60009dfa81c54cf99ac843b8b3bc0db1";
9+
10+
$cli = new Client($addr, $token);
11+
var_dump($cli->Produce("test-topic", "test_key", "test_value"));
12+
var_dump($cli->Consume("test-group", "test-topic"));
13+
var_dump($cli->Consume("test-group", "test-topic"));
14+
$cli->Close();

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# php-kaproxy-client
2+
3+
Impl php client for Kaproxy(HTTP Proxy For Kafka)
4+
5+
## Install
6+
7+
```
8+
> git clone [email protected]:platform/php-kaproxy-client.git
9+
> cd php-kaproxy-client
10+
> composer install
11+
```
12+
13+
## Example
14+
15+
```php
16+
require 'vendor/autoload.php';
17+
18+
use Kaproxy\Client;
19+
20+
$addr = "http://127.0.0.1:8080";
21+
$token = "60009dfa81c54cf99ac843b8b3bc0db1";
22+
23+
$cli = new Client($addr, $token);
24+
var_dump($cli->Produce("test-topic", "test_key", "test_value"));
25+
var_dump($cli->Consume("test-group", "test-topic"));
26+
$cli->Close();
27+
```
28+
29+
## Test
30+
31+
```
32+
> make test
33+
```

composer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "platform/php-kaproxy-client",
3+
"description": "kaproxy php client",
4+
"license": "Apache-2.0",
5+
"authors": [
6+
{
7+
"name": "hulk",
8+
"email": "[email protected]"
9+
}
10+
],
11+
"require-dev" : {
12+
"phpunit/phpunit": "5.6.*"
13+
},
14+
"autoload" : {
15+
"psr-4" : {"Kaproxy\\" : "src/"}
16+
}
17+
}

0 commit comments

Comments
 (0)