| Mark Slee | 5d06fea | 2007-03-05 22:18:18 +0000 | [diff] [blame] | 1 | Thrift PHP Software Library | 
 | 2 |  | 
| Bryan Duxbury | def30a6 | 2009-04-08 00:19:37 +0000 | [diff] [blame] | 3 | License | 
 | 4 | ======= | 
 | 5 |  | 
 | 6 | Licensed to the Apache Software Foundation (ASF) under one | 
 | 7 | or more contributor license agreements. See the NOTICE file | 
 | 8 | distributed with this work for additional information | 
 | 9 | regarding copyright ownership. The ASF licenses this file | 
 | 10 | to you under the Apache License, Version 2.0 (the | 
 | 11 | "License"); you may not use this file except in compliance | 
 | 12 | with the License. You may obtain a copy of the License at | 
 | 13 |  | 
 | 14 |   http://www.apache.org/licenses/LICENSE-2.0 | 
 | 15 |  | 
 | 16 | Unless required by applicable law or agreed to in writing, | 
 | 17 | software distributed under the License is distributed on an | 
 | 18 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 
 | 19 | KIND, either express or implied. See the License for the | 
 | 20 | specific language governing permissions and limitations | 
 | 21 | under the License. | 
| Mark Slee | 5d06fea | 2007-03-05 22:18:18 +0000 | [diff] [blame] | 22 |  | 
 | 23 | Using Thrift with PHP | 
 | 24 | ===================== | 
 | 25 |  | 
 | 26 | Thrift requires PHP 5. Thrift makes as few assumptions about your PHP | 
 | 27 | environment as possible while trying to make some more advanced PHP | 
 | 28 | features (i.e. APC cacheing using asbolute path URLs) as simple as possible. | 
 | 29 |  | 
 | 30 | To use Thrift in your PHP codebase, take the following steps: | 
 | 31 |  | 
| Roger Meier | 21c0a85 | 2012-09-05 19:47:14 +0000 | [diff] [blame] | 32 | #1) Copy all of thrift/lib/php/lib into your PHP codebase | 
 | 33 | #2) Configure Symfony Autoloader (or whatever you usually use) | 
| Mark Slee | 5d06fea | 2007-03-05 22:18:18 +0000 | [diff] [blame] | 34 |  | 
| Roger Meier | 21c0a85 | 2012-09-05 19:47:14 +0000 | [diff] [blame] | 35 | After thaht, you have to manually include the Thrift package | 
 | 36 | created by the compiler: | 
| Mark Slee | 5d06fea | 2007-03-05 22:18:18 +0000 | [diff] [blame] | 37 |  | 
| Roger Meier | 21c0a85 | 2012-09-05 19:47:14 +0000 | [diff] [blame] | 38 | require_once 'packages/Service/Service.php'; | 
 | 39 | require_once 'packages/Service/Types.php'; | 
| Mark Slee | 54b7ab9 | 2007-03-06 00:06:27 +0000 | [diff] [blame] | 40 |  | 
| Mark Slee | 5d06fea | 2007-03-05 22:18:18 +0000 | [diff] [blame] | 41 | Dependencies | 
 | 42 | ============ | 
 | 43 |  | 
 | 44 | PHP_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 |  | 
 | 50 | apc_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. |