blob: 40c79e0dd4003115c71234df4ea885c46df0ee71 [file] [log] [blame] [view]
Jayant Kolhe300748e2015-02-19 11:30:40 -08001
2#Overview
3
4This directory contains source code for PHP implementation of gRPC layered on shared C library.
5
6#Status
7
Jayant Kolhe691dbcc2015-02-19 11:31:20 -08008Pre-Alpha : This gRPC PHP implementation is work-in-progress and is not expected to work yet.
Jayant Kolhe300748e2015-02-19 11:30:40 -08009
mlumishb892a272014-12-09 16:28:23 -080010
11## LAYOUT
12
13Directory structure is as generated by the PHP utility
14[ext_skel](http://php.net/manual/en/internals2.buildsys.skeleton.php)
15
16## ENVIRONMENT
17
murgatroid99975a07b2015-02-02 14:10:42 -080018Install `php5` and `php5-dev`.
mlumishb892a272014-12-09 16:28:23 -080019
murgatroid99975a07b2015-02-02 14:10:42 -080020To run the tests, additionally install `php5-readline` and `phpunit`.
mlumishb892a272014-12-09 16:28:23 -080021
murgatroid99975a07b2015-02-02 14:10:42 -080022Alternatively, build and install PHP 5.5 or later from source with standard
23configuration options.
24
25To also download and install protoc and the PHP code generator.
mlumishb892a272014-12-09 16:28:23 -080026
27```bash
28apt-get install -y procps
29curl -sSL https://get.rvm.io | sudo bash -s stable --ruby
murgatroid99975a07b2015-02-02 14:10:42 -080030git clone git@github.com:google/protobuf.git
mlumishb892a272014-12-09 16:28:23 -080031cd protobuf
32./configure
33make
34make install
murgatroid99975a07b2015-02-02 14:10:42 -080035git clone git@github.com:murgatroid99/Protobuf-PHP.git
36cd Protobuf-PHP
mlumishb892a272014-12-09 16:28:23 -080037rake pear:package version=1.0
38pear install Protobuf-1.0.tgz
39```
40
41## BUILDING
42
43 1. In ./ext/grpc, run the command `phpize` (distributed with PHP)
44 2. Run `./ext/grpc/configure`
45 3. In ./ext/grpc, run `make` and `sudo make install`
46 4. In your php.ini file, add the line `extension=grpc.so` to load the
47 extension at PHP startup.
48
49## PHPUnit
50
51This repo now has PHPUnit tests, which can by run by executing
52`./bin/run_tests.sh` after building.
53
54There is also a generated code test (`./bin/run_gen_code_test.sh`), which tests
55the stub `./tests/generated_code/math.php` against a running localhost server
56serving the math service. That stub is generated from
murgatroid99975a07b2015-02-02 14:10:42 -080057`./tests/generated_code/math.proto`.