Skip to content

Ensure Client's $writeConcern property is initialized #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ env:
- MONGO_REPO_TYPE="precise/mongodb-enterprise/"
- SOURCES_LOC="/etc/apt/sources.list.d/mongodb.list"
matrix:
- DRIVER_VERSION=1.2.0alpha3 SERVER_VERSION=2.6
- DRIVER_VERSION=1.2.0alpha3 SERVER_VERSION=3.0
- DRIVER_VERSION=1.2.0alpha3 SERVER_VERSION=3.2
- DRIVER_VERSION=1.2.0 SERVER_VERSION=2.6
- DRIVER_VERSION=1.2.0 SERVER_VERSION=3.0
- DRIVER_VERSION=1.2.0 SERVER_VERSION=3.2

matrix:
fast_finish: true
include:
- php: 7.0
env: DRIVER_VERSION=1.2.0alpha3 SERVER_VERSION=2.4
env: DRIVER_VERSION=1.2.0 SERVER_VERSION=2.4
- php: 7.0
env: DRIVER_VERSION=devel SERVER_VERSION=3.2
exclude:
Expand Down
3 changes: 3 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Client
private $manager;
private $uri;
private $typeMap;
private $writeConcern;

/**
* Constructs a new Client instance.
Expand Down Expand Up @@ -63,6 +64,7 @@ public function __construct($uri = 'mongodb://127.0.0.1/', array $uriOptions = [
unset($driverOptions['typeMap']);

$this->manager = new Manager($uri, $uriOptions, $driverOptions);
$this->writeConcern = $this->manager->getWriteConcern();
}

/**
Expand All @@ -77,6 +79,7 @@ public function __debugInfo()
'manager' => $this->manager,
'uri' => $this->uri,
'typeMap' => $this->typeMap,
'writeConcern' => $this->writeConcern,
];
}

Expand Down