PHP code example of zorrow / thrift-parser-php

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

    

zorrow / thrift-parser-php example snippets



        $path = "./namespace.thrift";
        $parserCal = new ParserCal($path);
        $parserFunc = new ParserFunc($parserCal);

        $parser = new ThriftParser($parserFunc);
        $thriftNamespace = new ThriftNamespace($parserFunc);
        $parser->initSubject($thriftNamespace);

        $file = $parser->readThrift();


    [
        'namespace' => [
            'php' => [
                'serviceName'=>'SMS'
            ]
        ]
    ]