Skip to content

Commit

Permalink
Merge pull request grpc#7540 from stanley-cheung/php-minor-cleanup-ga…
Browse files Browse the repository at this point in the history
…-v1_0

PHP: minor cleanup for GA v1.0 branch
  • Loading branch information
stanley-cheung authored Jul 27, 2016
2 parents ee70fa7 + b2d5904 commit 6511a87
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 39 deletions.
2 changes: 1 addition & 1 deletion examples/php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"description": "gRPC example for PHP",
"minimum-stability": "dev",
"require": {
"grpc/grpc": "v0.15.0"
"grpc/grpc": "v0.15.2"
}
}
43 changes: 11 additions & 32 deletions src/php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions src/php/bin/determine_extension_dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 6511a87

Please sign in to comment.