blob: 84d60e13078bf229f3d767b8112105aa1fc9a025 [file] [log] [blame]
Mark Slee5d06fea2007-03-05 22:18:18 +00001Thrift PHP Software Library
2
3Mark Slee (mcslee@facebook.com)
4
5Thrift is distributed under the Thrift open source software license.
6Please see the included LICENSE file.
7
8Using Thrift with PHP
9=====================
10
11Thrift requires PHP 5. Thrift makes as few assumptions about your PHP
12environment as possible while trying to make some more advanced PHP
13features (i.e. APC cacheing using asbolute path URLs) as simple as possible.
14
15To 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
21Note that #3 must be done before including any other Thrift files.
22If you do not do #2, Thrift.php will set this global for you, but it will be
23done using dirname(__FILE__), which is less efficient than providing the static
24string yourself.
25
26Dependencies
27============
28
29PHP_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
35apc_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.