zorrow / thrift-parser-php
parse thrift file by php
Installs: 39
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 3
pkg:composer/zorrow/thrift-parser-php
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: ^5.5
This package is not auto-updated.
Last update: 2025-12-27 01:49: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'
]
]
]