PHP code example of overblog / thrift-bundle

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

    

overblog / thrift-bundle example snippets


// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        ...
        new Overblog\ThriftBundle\OverblogThriftBundle(),
        ...
    );

    return $bundles;
}
 app/console thrift:compile CompleteBundleName Service
 app/console cache:warmup

// your_controller.php

$service = $this->getContainer()->get('thrift.client.*client_name*');
$client = $service->getClient();

$service = $service->getFactory('ThriftModel\Service\Service');
$service->property = 121354984651354647;
$service->name = 'Name 1';

$id = $client->execMethod($service);