PHPackages                             rf/amazon-kinesis-client-library-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rf/amazon-kinesis-client-library-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rf/amazon-kinesis-client-library-php
====================================

Amazon Kinesis Wrapper Class

0.0.2(12y ago)63784[1 PRs](https://github.com/fukuiretu/amazon-kinesis-client-library-php/pulls)MITPHPPHP &gt;=5.3.3

Since Mar 30Pushed 10y ago1 watchersCompare

[ Source](https://github.com/fukuiretu/amazon-kinesis-client-library-php)[ Packagist](https://packagist.org/packages/rf/amazon-kinesis-client-library-php)[ Docs](https://github.com/fukuiretu/amazon-kinesis-client-library-php)[ RSS](/packages/rf-amazon-kinesis-client-library-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

amazon-kinesis-client-library-php
=================================

[](#amazon-kinesis-client-library-php)

[![Build Status](https://camo.githubusercontent.com/0ddda9936561e62f0b1ab922723f96283404c0baa964b273396ecc1831b70b3a/68747470733a2f2f7472617669732d63692e6f72672f66756b7569726574752f616d617a6f6e2d6b696e657369732d636c69656e742d6c6962726172792d7068702e7376673f6272616e63683d302e302e31)](https://travis-ci.org/fukuiretu/amazon-kinesis-client-library-php)

Overview
========

[](#overview)

Wrapper library of Amazon Kinesis Client Module.()

I want to simplify the management of Shard Id and Sequence Number taken out from the Stream. In addition, storage to manage is also an option.

Requirements
============

[](#requirements)

- PHP &gt;= 5.3.3
- aws-sdk-php ()
- \[option\] memcache.so () AND memcached ()

Installation
============

[](#installation)

### Using Composer

[](#using-composer)

composer.json

```
{
    "require": {
        "rf/amazon-kinesis-client-library-php": "0.0.1"
    }
}

```

### Copy Directory

[](#copy-directory)

```
git clone https://github.com/fukuiretu/amazon-kinesis-client-library-php.git
cp -r src/Rf

```

Usage
=====

[](#usage)

### CASE: Data push

[](#case-data-push)

```
require 'vendor/autoload.php';

use Aws\Kinesis\KinesisClient;
use Aws\Common\Enum\Region;
use Rf\Aws\AutoLoader;
use Rf\Aws\Kinesis\ClientLibrary\KinesisProxy;
use Rf\Aws\Kinesis\ClientLibrary\KinesisShardFileDataStore;
use Rf\Aws\Kinesis\ClientLibrary\KinesisShardMemcacheDataStore;
use Rf\Aws\Kinesis\ClientLibrary\KinesisStorageManager;

define('STREAM_NAME', 'kinesis-trial');
$kinesis = KinesisClient::factory(array(
  'key' => 'XXXXX',
  'secret' => 'XXXXX',
  'region' => Region::VIRGINIA
));
$kinesis_proxy = KinesisProxy::factory($kinesis, STREAM_NAME);

while (true) {
    $sample_data = date('YmdHis');
    $kinesis_proxy->putRecord($sample_data, mt_rand(1, 1000000));

    echo $sample_data, PHP_EOL;
    sleep(1);
}

```

### CASE: Memcache the Data Store

[](#case-memcache-the-data-store)

```
