Working with Apache Thrift in PHP can be described through the following few steps:
- Defining the services through the IDL file
- Autogenerating language bindings
- Providing PHP implementation of defined interfaces
- Exposing provided service implementation through the server
- Consuming exposed services via client
Thrift services begin their life as .thrift files, that is, files described by IDL.
The IDL files support definition of several data types:
- bool: This is a Boolean value (true or false)
- byte: This is an 8-bit signed integer
- i16: This is a 16-bit signed integer
- i32: This is a 32-bit signed integer
- i64: This is a 64-bit signed integer
- double: This is a 64-bit floating point number
- string: This is a UTF-8 encoded text ...