zorrow / thrift-parser-php
parse thrift file by php
v0.0.2
2017-09-20 06:50 UTC
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: ^5.5
This package is not auto-updated.
Last update: 2025-06-27 23:16:48 UTC
README
To parse thrift file to struct,support const、enum、exception、include、namespace、service、struct、typedef and union
Example
ParserCal,ParserFunc are baisc functions.
initSubject function (Class ThriftParser) is to set the sets which will be dealed.
$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();
Return
[ 'namespace' => [ 'php' => [ 'serviceName'=>'SMS' ] ] ]