PHP code example of pengtao / sdk_datacenter

1. Go to this page and download the library: Download pengtao/sdk_datacenter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pengtao / sdk_datacenter example snippets


$config = [
    'params' => [
        '_app_token' => '',
        '_channel' => '',
        '_version' => '',
        '_time' => time(),
        'uri' => '',
        'params' => ''
    ],
    'secert' => ''
];
$dataCenter = new DataCenter($config);
$dataCenter->base->send();

$config = [
    'redis' => 
        [
            'scheme' => 'tcp',
            'host'   => '0.0.0.0',
            'port'   => '6379',
            'database' => 6
        ]
];
$dataCenterStat = new DataCenterStat($config);
$bookStat = $dataCenterStat->book;
$bookStat->setBookId(11111);
$bookStat->setChapterId(22222);
$bookStat->setUserId(333333);
$bookStat->setReadDate(44444);
$bookStat->setChannel(555555);
$bookStat->setApp(88888);
$bookStat->setReadSeconds(66666);

$bookStat->setReadBookNumber();