| 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
|
|
|