Skip to content

Commit 17f31ff

Browse files
authored
Merge pull request #271 from alcaeus/fix-missing-ok-field
Always return 1 for health in MongoClient::getHosts
2 parents 6605643 + 0f17df6 commit 17f31ff

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
# Test against legacy driver to ensure validity of the test suite
4646
- stage: Test
4747
php: 5.6
48+
env: DRIVER_VERSION="1.7.5"
4849
install:
4950
- yes '' | pecl -q install -f mongo
5051

lib/Mongo/MongoClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function getHosts()
222222
$results[$key] = [
223223
'host' => $server->getHost(),
224224
'port' => $server->getPort(),
225-
'health' => (int) $info['ok'],
225+
'health' => 1,
226226
'state' => $state,
227227
'ping' => $server->getLatency(),
228228
'lastPing' => null,

0 commit comments

Comments
 (0)