blob: af6cf88d33e7b5d3ac8aa766ccc61a49427e1135 [file] [log] [blame]
Mark Slee5d06fea2007-03-05 22:18:18 +00001Thrift PHP Software Library
2
Bryan Duxburydef30a62009-04-08 00:19:37 +00003License
4=======
5
6Licensed to the Apache Software Foundation (ASF) under one
7or more contributor license agreements. See the NOTICE file
8distributed with this work for additional information
9regarding copyright ownership. The ASF licenses this file
10to you under the Apache License, Version 2.0 (the
11"License"); you may not use this file except in compliance
12with the License. You may obtain a copy of the License at
13
14 http://www.apache.org/licenses/LICENSE-2.0
15
16Unless required by applicable law or agreed to in writing,
17software distributed under the License is distributed on an
18"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19KIND, either express or implied. See the License for the
20specific language governing permissions and limitations
21under the License.
Mark Slee5d06fea2007-03-05 22:18:18 +000022
23Using Thrift with PHP
24=====================
25
26Thrift requires PHP 5. Thrift makes as few assumptions about your PHP
27environment as possible while trying to make some more advanced PHP
28features (i.e. APC cacheing using asbolute path URLs) as simple as possible.
29
30To use Thrift in your PHP codebase, take the following steps:
31
Roger Meier21c0a852012-09-05 19:47:14 +000032#1) Copy all of thrift/lib/php/lib into your PHP codebase
33#2) Configure Symfony Autoloader (or whatever you usually use)
Mark Slee5d06fea2007-03-05 22:18:18 +000034
Roger Meier21c0a852012-09-05 19:47:14 +000035After thaht, you have to manually include the Thrift package
36created by the compiler:
Mark Slee5d06fea2007-03-05 22:18:18 +000037
Roger Meier21c0a852012-09-05 19:47:14 +000038require_once 'packages/Service/Service.php';
39require_once 'packages/Service/Types.php';
Mark Slee54b7ab92007-03-06 00:06:27 +000040
Mark Slee5d06fea2007-03-05 22:18:18 +000041Dependencies
42============
43
44PHP_INT_SIZE
45
46 This built-in signals whether your architecture is 32 or 64 bit and is
47 used by the TBinaryProtocol to properly use pack() and unpack() to
48 serialize data.
49
50apc_fetch(), apc_store()
51
52 APC cache is used by the TSocketPool class. If you do not have APC installed,
53 Thrift will fill in null stub function definitions.