Skip to content

Commit 9d218a7

Browse files
committed
PHPLIB-98: Ensure mongod service is started for all versions
We need to account for differing service names between 2.4 and 2.6+.
1 parent 5076ff1 commit 9d218a7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ install:
2727
- sudo apt-get install ${SERVER_PACKAGE}
2828

2929
before_script:
30+
- if dpkg --compare-versions ${SERVER_VERSION} le "2.4"; then export SERVER_SERVICE=mongodb; else export SERVER_SERVICE=mongod; fi
31+
- if ! nc -z localhost 27017; then sudo service ${SERVER_SERVICE} start; fi
3032
- mongod --version
3133
- pecl install -f mongodb-${DRIVER_VERSION}
3234
- php --ri mongodb

0 commit comments

Comments
 (0)