PHP code example of tefps / clients-bundle

1. Go to this page and download the library: Download tefps/clients-bundle 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/ */

    

tefps / clients-bundle example snippets



// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Tefps\TefpsClientsBundle\TefpsClientsBundle(),
        );

        // ...
    }

    // ...
}



use Tefps\TefpsClientsBundle\Tv\TefpsTvClient;
use Tefps\TefpsClientsBundle\Auth\OAuth2HttpClient;

// ...

$client = new TefpsTvClient(new OAuth2HttpClient(
        'http://tefps-directory-host:port',
        'clientId',
        'clientSecret'),
        'http://tefps-tv-host:port'
      );

$tv = $client->fetchTv("cityId", "tvId");





use Tefps\TefpsClientsBundle\Tv\TefpsSubscriberClient;
use Tefps\TefpsClientsBundle\Auth\OAuth2HttpClient;

// ...

$client = new TefpsSubscriberClient(new OAuth2HttpClient(
        'http://tefps-directory-host:port',
        'clientId',
        'clientSecret'),
        'http://tefps-subscriber-host:port'
      );

$subscriber = $client->fetchSubscriber("cityId", "subscriberId");