Skip to content

PHPC-995: Drop support for MongoDB 2.4 #676

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 1 commit into from
Nov 21, 2017
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
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ URIs and resemble the following:
```
{
"STANDALONE": "mongodb:\/\/192.168.112.10:2000",
"STANDALONE_24": "mongodb:\/\/192.168.112.10:2500",
"STANDALONE_26": "mongodb:\/\/192.168.112.10:2600",
"STANDALONE_30": "mongodb:\/\/192.168.112.10:2700",
"STANDALONE_SSL": "mongodb:\/\/192.168.112.10:2100",
Expand Down
15 changes: 0 additions & 15 deletions scripts/presets/standalone-24.json

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/start-servers.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function lap() {
$PRESETS = [
"standalone" => [
"scripts/presets/standalone.json",
"scripts/presets/standalone-24.json",
"scripts/presets/standalone-26.json",
"scripts/presets/standalone-30.json",
"scripts/presets/standalone-ssl.json",
Expand Down Expand Up @@ -124,7 +123,6 @@ function mo_http_request($uri, $context) {
wget --body-data='' --method='GET' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers
wget --body-data='' --method='DELETE' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers/STANDALONE-AUTH
wget --body-data='' --method='DELETE' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers/STANDALONE
wget --body-data='' --method='DELETE' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers/STANDALONE-24
wget --body-data='' --method='DELETE' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers/STANDALONE-26
wget --body-data='' --method='DELETE' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers/RS-two
wget --body-data='' --method='DELETE' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers/RS-arbiter
Expand All @@ -141,7 +139,6 @@ function mo_http_request($uri, $context) {
wget --body-data='' --method='GET' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/replica_sets

wget --body-data='{"preset":"\/phongo\/\/scripts\/presets\/standalone.json"}' --method='POST' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers
wget --body-data='{"preset":"\/phongo\/\/scripts\/presets\/standalone-24.json"}' --method='POST' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers
wget --body-data='{"preset":"\/phongo\/\/scripts\/presets\/standalone-26.json"}' --method='POST' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers
wget --body-data='{"preset":"\/phongo\/\/scripts\/presets\/standalone-ssl.json"}' --method='POST' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers
wget --body-data='{"preset":"\/phongo\/\/scripts\/presets\/standalone-auth.json"}' --method='POST' --header='Accept: application/json' --header='Content-type: application/x-www-form-urlencoded' http://192.168.112.10:8889/servers
Expand Down
3 changes: 1 addition & 2 deletions scripts/ubuntu/mongo-orchestration-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"releases": {
"32-release": "/home/vagrant/3.2.0/usr/bin",
"30-release": "/home/vagrant/3.0.3/usr/bin",
"26-release": "/home/vagrant/2.6.9/usr/bin",
"24-release": "/home/vagrant/2.4.13/usr/bin"
"26-release": "/home/vagrant/2.6.9/usr/bin"
}
}
3 changes: 0 additions & 3 deletions scripts/ubuntu/mongo-orchestration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo 'deb http://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/3.2 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise-3.2.list
echo 'deb http://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/3.0 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise-3.0.list
echo 'deb http://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/2.6 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise-2.6.list
echo 'deb http://repo.mongodb.com/apt/ubuntu precise/mongodb-enterprise/2.4 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-enterprise-2.4.list
apt-get update

apt-get install -y libsnmp15 libgsasl7
Expand All @@ -14,8 +13,6 @@ sudo apt-get download mongodb-enterprise-server=3.2.0
sudo apt-get download mongodb-enterprise-mongos=3.2.0
sudo apt-get download mongodb-enterprise-server=3.0.3
sudo apt-get download mongodb-enterprise-server=2.6.9
sudo apt-get download mongodb-10gen-enterprise=2.4.13
dpkg -x mongodb-10gen-enterprise_2.4.13_amd64.deb 2.4.13
dpkg -x mongodb-enterprise-server_2.6.9_amd64.deb 2.6.9
dpkg -x mongodb-enterprise-server_3.0.3_amd64.deb 3.0.3
dpkg -x mongodb-enterprise-server_3.2.0_amd64.deb 3.2.0
Expand Down
29 changes: 0 additions & 29 deletions src/MongoDB/BulkWrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@

zend_class_entry *php_phongo_bulkwrite_ce;

/* Returns whether the insert document appears to be a legacy index. */
static inline bool php_phongo_bulkwrite_insert_is_legacy_index(bson_t *bdocument) /* {{{ */
{
bson_iter_t iter;

if (bson_iter_init_find(&iter, bdocument, "key") && BSON_ITER_HOLDS_DOCUMENT(&iter) &&
bson_iter_init_find(&iter, bdocument, "name") && BSON_ITER_HOLDS_UTF8(&iter) &&
bson_iter_init_find(&iter, bdocument, "ns") && BSON_ITER_HOLDS_UTF8(&iter)) {
return true;
}

return false;
} /* }}} */

/* Extracts the "_id" field of a BSON document into a return value. */
static void php_phongo_bulkwrite_extract_id(bson_t *doc, zval **return_value) /* {{{ */
{
Expand Down Expand Up @@ -243,21 +229,6 @@ static PHP_METHOD(BulkWrite, insert)
goto cleanup;
}

/* If the insert document appears to be a legacy index, instruct libmongoc
* to allow dots in BSON keys by setting the "legacyIndex" option.
*
* Note: php_phongo_zval_to_bson() may have added an ObjectId if the "_id"
* field was unset. We don't know at this point if the insert is destined
* for a pre-2.6 server's "system.indexes" collection, but legacy index
* creation will ignore the "_id" so there is no harm in leaving it. In the
* event php_phongo_bulkwrite_insert_is_legacy_index() returns a false
* positive, we absolutely want ObjectId added if "_id" was unset. */
if (php_phongo_bulkwrite_insert_is_legacy_index(&bdocument) &&
!BSON_APPEND_BOOL(&boptions, "legacyIndex", true)) {
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error appending \"legacyIndex\" option");
goto cleanup;
}

if (!mongoc_bulk_operation_insert_with_opts(intern->bulk, &bdocument, &boptions, &error)) {
phongo_throw_exception_from_bson_error_t(&error TSRMLS_CC);
goto cleanup;
Expand Down
34 changes: 0 additions & 34 deletions tests/bulk/bulkwrite-insert_error-004.phpt

This file was deleted.

1 change: 0 additions & 1 deletion tests/utils/basic.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ if (!$config) {

$servers = array(
"STANDALONE" => "",
"STANDALONE_24" => "",
"STANDALONE_26" => "",
"STANDALONE_30" => "",
"STANDALONE_SSL" => "",
Expand Down