Skip to content

Commit ca2f950

Browse files
committed
Standardize extension building logic
1 parent 6618605 commit ca2f950

File tree

6 files changed

+46
-26
lines changed

6 files changed

+46
-26
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ before_script:
4646

4747
script:
4848
- ./bin/compile
49-
- ./bin/compile-extensions || true
50-
- if [[ $VERSION =~ ^7 ]]; then ./bin/compile-extension-redis; fi
51-
- if [[ $VERSION =~ ^7 ]]; then ./bin/compile-extension-mongodb; fi
52-
- if [[ $VERSION =~ ^7 ]]; then ./bin/compile-extension-amqp; fi
53-
- if [[ $VERSION =~ ^7 ]]; then ./bin/compile-extension-zmq; fi
49+
# - ./bin/compile-extensions
50+
- ./bin/compile-extension-redis
51+
- ./bin/compile-extension-mongodb
52+
- ./bin/compile-extension-amqp
53+
- ./bin/compile-extension-zmq
5454
- ./bin/compile-extension-memcached
5555

5656
after_success: ./bin/archive

bin/compile-extension-amqp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ git submodule update
88
autoreconf -i && ./configure && make && sudo make install
99

1010
popd
11+
12+
## still need to build extension
13+
14+
true

bin/compile-extension-mongodb

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/bash
2-
32
set -o xtrace
43

5-
git clone --branch PHP7 https://github.com/mongodb-labs/mongo-php-driver-prototype.git
6-
pushd mongo-php-driver-prototype
7-
git submodule update --init
8-
phpize
9-
./configure
10-
make all
11-
make install
12-
popd
4+
if [[ $VERSION =~ ^7 ]]; then
5+
git clone --branch PHP7 https://github.com/mongodb-labs/mongo-php-driver-prototype.git
6+
pushd mongo-php-driver-prototype
7+
git submodule update --init
8+
phpize
9+
./configure
10+
make all
11+
make install
12+
popd
13+
else
14+
source $(dirname $0)/compile-extensions-common
15+
pecl_install mongodb
16+
fi
17+
18+
true

bin/compile-extension-redis

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
#!/bin/bash
22
set -o xtrace
33

4-
git clone https://github.com/phpredis/phpredis.git --branch php7
5-
pushd phpredis
6-
phpize
7-
./configure
8-
make && make install
9-
popd
4+
if [[ $VERSION =~ ^7 ]]; then
5+
git clone https://github.com/phpredis/phpredis.git --branch php7
6+
pushd phpredis
7+
phpize
8+
./configure
9+
make && make install
10+
popd
11+
else
12+
source $(dirname $0)/compile-extensions-common
13+
pecl_install redis
14+
fi

bin/compile-extension-zmq

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
#!/bin/bash
22
set -o xtrace
33

4-
git clone https://github.com/mkoppanen/php-zmq.git --branch php7
5-
pushd php-zmq
6-
autoreconf -i && ./configure && make && sudo make install
4+
if [[ $VERSION =~ ^7 ]]; then
5+
git clone https://github.com/mkoppanen/php-zmq.git --branch php7
6+
pushd php-zmq
7+
autoreconf -i && ./configure && make && sudo make install
78

8-
popd
9+
popd
10+
else
11+
source $(dirname $0)/compile-extensions-common
12+
pecl_install zmq
13+
fi
14+
15+
true

bin/compile-extensions

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ phpenv global ${VERSION}
77

88
source $(dirname $0)/compile-extensions-common
99

10-
pecl_install mongodb
11-
# pecl_install redis

0 commit comments

Comments
 (0)