zorrow / thrift-parser-php
parse thrift file by php
v0.0.2
2017-09-20 06:50 UTC
Requires
None
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: ^5.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-05 05:36:24 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'
]
]
]