Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: third_party/grpc/src/php/bin/determine_extension_dir.sh

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/grpc/src/php/README.md ('k') | third_party/grpc/src/php/bin/generate_proto_php.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/src/php/bin/determine_extension_dir.sh
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/echo-with-no-extension_wsh.py b/third_party/grpc/src/php/bin/determine_extension_dir.sh
old mode 100644
new mode 100755
similarity index 63%
copy from third_party/WebKit/LayoutTests/http/tests/websocket/echo-with-no-extension_wsh.py
copy to third_party/grpc/src/php/bin/determine_extension_dir.sh
index 4206831cb5135d5e03928bf9d995b2bf9e156018..b4342ac89fa8e562e4160e39dcad11eb9335ed43
--- a/third_party/WebKit/LayoutTests/http/tests/websocket/echo-with-no-extension_wsh.py
+++ b/third_party/grpc/src/php/bin/determine_extension_dir.sh
@@ -1,4 +1,5 @@
-# Copyright 2012, Google Inc.
+#!/bin/bash
+# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -26,23 +27,25 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-_GOODBYE_MESSAGE = u'Goodbye'
-
-
-def web_socket_do_extra_handshake(request):
- request.ws_extension_processors = []
-
-
-def web_socket_transfer_data(request):
- while True:
- line = request.ws_stream.receive_message()
- if line is None:
- return
- if isinstance(line, unicode):
- request.ws_stream.send_message(line, binary=False)
- if line == _GOODBYE_MESSAGE:
- return
- else:
- request.ws_stream.send_message(line, binary=True)
+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
+ # the grpc extension is not found in the default PHP extension dir
+ # try the source modules directory
+ module_dir=../ext/grpc/modules
+ if [ ! -e $module_dir/grpc.so ]; then
+ echo "Please run 'phpize && ./configure && make' from ext/grpc first"
+ exit 1
+ fi
+ # sym-link in system supplied extensions
+ for f in $default_extension_dir/*.so; do
+ ln -s $f $module_dir/$(basename $f) &> /dev/null || true
+ done
+ extension_dir="-d extension_dir=${module_dir} -d extension=grpc.so"
+else
+ extension_dir="-d extension=grpc.so"
+fi
« no previous file with comments | « third_party/grpc/src/php/README.md ('k') | third_party/grpc/src/php/bin/generate_proto_php.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698