aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanley.cheung@gmail.com>2016-07-26 19:32:34 -0700
committerGravatar GitHub <noreply@github.com>2016-07-26 19:32:34 -0700
commit6511a874f9801355f82d863e731737cee3f807f3 (patch)
tree237b00e0761f37c4ebd7f091b8ec475cfd3786a9
parentee70fa70226bd10524e06a4b4f8ab19e38af946e (diff)
parentb2d590463f9aacfa543a3171a040290b6f67a28e (diff)
Merge pull request #7540 from stanley-cheung/php-minor-cleanup-ga-v1_0
PHP: minor cleanup for GA v1.0 branch
-rw-r--r--examples/php/composer.json2
-rw-r--r--src/php/README.md43
-rwxr-xr-xsrc/php/bin/determine_extension_dir.sh6
-rw-r--r--src/php/composer.json4
4 files changed, 16 insertions, 39 deletions
diff --git a/examples/php/composer.json b/examples/php/composer.json
index a8b790b1de..d40b5db059 100644
--- a/examples/php/composer.json
+++ b/examples/php/composer.json
@@ -3,6 +3,6 @@
"description": "gRPC example for PHP",
"minimum-stability": "dev",
"require": {
- "grpc/grpc": "v0.15.0"
+ "grpc/grpc": "v0.15.2"
}
}
diff --git a/src/php/README.md b/src/php/README.md
index 8abedc40a3..7e9819b256 100644
--- a/src/php/README.md
+++ b/src/php/README.md
@@ -9,23 +9,12 @@ GA
## Environment
-Prerequisite: `php` >=5.5, `phpize`, `pecl`, `phpunit`
-
-**Linux (Debian):**
-
-```sh
-$ sudo apt-get install php5 php5-dev php-pear
-```
-
-**Linux (CentOS):**
-
-```sh
-$ yum install php55w
-$ yum --enablerepo=remi,remi-php55 install php-devel php-pear
-```
-
-**Mac OS X:**
+Prerequisite:
+* `php` 5.5 or above, 7.0 or above
+* `pear` and `pecl`
+* `phpunit`
+**PEAR:**
```sh
$ curl -O http://pear.php.net/go-pear.phar
$ sudo php -d detect_unicode=0 go-pear.phar
@@ -72,13 +61,7 @@ $ sudo make install
### gRPC PHP extension
-Install the gRPC PHP extension from PECL
-
-```sh
-$ sudo pecl install grpc
-```
-
-Or, compile from source
+Compile the gRPC PHP extension
```sh
$ cd grpc/src/php/ext/grpc
@@ -148,12 +131,8 @@ Alternatively, you can download `protoc` binaries from [the protocol buffers Git
You need to install `protoc-gen-php` to generate stub class `.php` files from service definition `.proto` files.
```sh
-$ cd grpc/src/php/vendor/stanley-cheung/protobuf-php # if you had run `composer install` in the previous step
-
-OR
-
-$ git clone https://github.com/stanley-cheung/Protobuf-PHP # clone from github repo
-
+$ git clone https://github.com/stanley-cheung/Protobuf-PHP
+$ cd Protobuf-PHP
$ gem install rake ronn
$ rake pear:package version=1.0
$ sudo pear install Protobuf-1.0.tgz
@@ -175,7 +154,7 @@ Run a local server serving the math services. Please see [Node][] for how to run
```sh
$ cd grpc
$ npm install
-$ nodejs src/node/test/math/math_server.js
+$ node src/node/test/math/math_server.js
```
### Run test client
@@ -212,7 +191,7 @@ Make sure the Node math server is still running, as above.
```sh
$ cd grpc
$ npm install
-$ nodejs src/node/test/math/math_server.js
+$ node src/node/test/math/math_server.js
```
Make sure you have run `composer install` to generate the `vendor/autoload.php` file
@@ -282,7 +261,7 @@ Make sure the Node math server is still running, as above.
```sh
$ cd grpc
$ npm install
-$ nodejs src/node/test/math/math_server.js
+$ node src/node/test/math/math_server.js
```
Make sure you have run `composer install` to generate the `vendor/autoload.php` file
diff --git a/src/php/bin/determine_extension_dir.sh b/src/php/bin/determine_extension_dir.sh
index b4342ac89f..a59882506f 100755
--- a/src/php/bin/determine_extension_dir.sh
+++ b/src/php/bin/determine_extension_dir.sh
@@ -29,11 +29,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -e
default_extension_dir=$(php-config --extension-dir)
-if command -v brew > /dev/null && \
- brew ls --versions | grep php5[56]-grpc > /dev/null; then
- # the grpc php extension was installed by homebrew
- :
-elif [ ! -e $default_extension_dir/grpc.so ]; then
+if [ ! -e $default_extension_dir/grpc.so ]; then
# the grpc extension is not found in the default PHP extension dir
# try the source modules directory
module_dir=../ext/grpc/modules
diff --git a/src/php/composer.json b/src/php/composer.json
index 88418206e8..1eacc643a2 100644
--- a/src/php/composer.json
+++ b/src/php/composer.json
@@ -8,7 +8,9 @@
"version": "1.0.0",
"require": {
"php": ">=5.5.0",
- "stanley-cheung/protobuf-php": "v0.6",
+ "stanley-cheung/protobuf-php": "v0.6"
+ },
+ "require-dev": {
"google/auth": "v0.9"
},
"autoload": {