Mark Slee | 5d06fea | 2007-03-05 22:18:18 +0000 | [diff] [blame] | 1 | Thrift PHP Software Library |
| 2 | |
| 3 | Mark Slee (mcslee@facebook.com) |
| 4 | |
| 5 | Thrift is distributed under the Thrift open source software license. |
| 6 | Please see the included LICENSE file. |
| 7 | |
| 8 | Using Thrift with PHP |
| 9 | ===================== |
| 10 | |
| 11 | Thrift requires PHP 5. Thrift makes as few assumptions about your PHP |
| 12 | environment as possible while trying to make some more advanced PHP |
| 13 | features (i.e. APC cacheing using asbolute path URLs) as simple as possible. |
| 14 | |
| 15 | To use Thrift in your PHP codebase, take the following steps: |
| 16 | |
| 17 | #1) Copy all of thrift/lib/php/src into your PHP codebase |
| 18 | #2) Set $GLOBALS['THRIFT_ROOT'] to the path you installed Thrift |
| 19 | #3) include_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php'; |
| 20 | |
| 21 | Note that #3 must be done before including any other Thrift files. |
| 22 | If you do not do #2, Thrift.php will set this global for you, but it will be |
| 23 | done using dirname(__FILE__), which is less efficient than providing the static |
| 24 | string yourself. |
| 25 | |
| 26 | Dependencies |
| 27 | ============ |
| 28 | |
| 29 | PHP_INT_SIZE |
| 30 | |
| 31 | This built-in signals whether your architecture is 32 or 64 bit and is |
| 32 | used by the TBinaryProtocol to properly use pack() and unpack() to |
| 33 | serialize data. |
| 34 | |
| 35 | apc_fetch(), apc_store() |
| 36 | |
| 37 | APC cache is used by the TSocketPool class. If you do not have APC installed, |
| 38 | Thrift will fill in null stub function definitions. |