Skip to content

PHPC-2346: Remove deprecated BSON functions #1653

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 3 commits into from
Sep 18, 2024
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
2 changes: 2 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ UPGRADE FROM 1.x to 2.0
* The `getServer()` method has been removed from the CommandFailedEvent,
CommandStartedEvent, and CommandSucceededEvent event classes. The `getHost()`
and `getPort()` methods have been added in its place.
* The BSON functions in the `MongoDB\BSON` namespace have been removed in favor
of the `MongoDB\BSON\Document` class.
1 change: 0 additions & 1 deletion config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ if test "$PHP_MONGODB" != "no"; then
src/BSON/Unserializable.c \
src/BSON/UTCDateTime.c \
src/BSON/UTCDateTimeInterface.c \
src/BSON/functions.c \
src/MongoDB/BulkWrite.c \
src/MongoDB/ClientEncryption.c \
src/MongoDB/Command.c \
Expand Down
2 changes: 1 addition & 1 deletion config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if (PHP_MONGODB != "no") {

EXTENSION("mongodb", "php_phongo.c", null, PHP_MONGODB_CFLAGS);
MONGODB_ADD_SOURCES("/src", "phongo_apm.c phongo_bson.c phongo_bson_encode.c phongo_client.c phongo_compat.c phongo_error.c phongo_execute.c phongo_ini.c phongo_log.c phongo_util.c");
MONGODB_ADD_SOURCES("/src/BSON", "Binary.c BinaryInterface.c Document.c Iterator.c DBPointer.c Decimal128.c Decimal128Interface.c Int64.c Javascript.c JavascriptInterface.c MaxKey.c MaxKeyInterface.c MinKey.c MinKeyInterface.c ObjectId.c ObjectIdInterface.c PackedArray.c Persistable.c Regex.c RegexInterface.c Serializable.c Symbol.c Timestamp.c TimestampInterface.c Type.c Undefined.c Unserializable.c UTCDateTime.c UTCDateTimeInterface.c functions.c");
MONGODB_ADD_SOURCES("/src/BSON", "Binary.c BinaryInterface.c Document.c Iterator.c DBPointer.c Decimal128.c Decimal128Interface.c Int64.c Javascript.c JavascriptInterface.c MaxKey.c MaxKeyInterface.c MinKey.c MinKeyInterface.c ObjectId.c ObjectIdInterface.c PackedArray.c Persistable.c Regex.c RegexInterface.c Serializable.c Symbol.c Timestamp.c TimestampInterface.c Type.c Undefined.c Unserializable.c UTCDateTime.c UTCDateTimeInterface.c");
MONGODB_ADD_SOURCES("/src/MongoDB", "BulkWrite.c ClientEncryption.c Command.c Cursor.c CursorId.c CursorInterface.c Manager.c Query.c ReadConcern.c ReadPreference.c Server.c ServerApi.c ServerDescription.c Session.c TopologyDescription.c WriteConcern.c WriteConcernError.c WriteError.c WriteResult.c");
MONGODB_ADD_SOURCES("/src/MongoDB/Exception", "AuthenticationException.c BulkWriteException.c CommandException.c ConnectionException.c ConnectionTimeoutException.c EncryptionException.c Exception.c ExecutionTimeoutException.c InvalidArgumentException.c LogicException.c RuntimeException.c ServerException.c SSLConnectionException.c UnexpectedValueException.c WriteException.c");
MONGODB_ADD_SOURCES("/src/MongoDB/Monitoring", "CommandFailedEvent.c CommandStartedEvent.c CommandSubscriber.c CommandSucceededEvent.c LogSubscriber.c SDAMSubscriber.c Subscriber.c ServerChangedEvent.c ServerClosedEvent.c ServerHeartbeatFailedEvent.c ServerHeartbeatStartedEvent.c ServerHeartbeatSucceededEvent.c ServerOpeningEvent.c TopologyChangedEvent.c TopologyClosedEvent.c TopologyOpeningEvent.c functions.c");
Expand Down
143 changes: 0 additions & 143 deletions src/BSON/functions.c

This file was deleted.

20 changes: 0 additions & 20 deletions src/functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,6 @@

/** @generate-function-entries */

namespace MongoDB\BSON {
/** @deprecated use MongoDB\BSON\Document::fromJSON instead */
function fromJSON(string $json): string {}

/** @deprecated use MongoDB\BSON\Document::fromPHP instead */
function fromPHP(array|object $value): string {}

/** @deprecated use MongoDB\BSON\Document::toCanonicalExtendedJSON instead */
function toCanonicalExtendedJSON(string $bson): string {}

/** @deprecated */
function toJSON(string $bson): string {}

/** @deprecated use MongoDB\BSON\Document::toPHP instead */
function toPHP(string $bson, ?array $typemap = null): array|object {}

/** @deprecated use MongoDB\BSON\Document::toRelaxedExtendedJSON instead */
function toRelaxedExtendedJSON(string $bson): string {}
}

namespace MongoDB\Driver\Monitoring {
function addSubscriber(Subscriber $subscriber): void {}

Expand Down
35 changes: 1 addition & 34 deletions src/functions_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 0 additions & 45 deletions tests/bson/bson-fromJSON-001.phpt

This file was deleted.

72 changes: 0 additions & 72 deletions tests/bson/bson-fromJSON-002.phpt

This file was deleted.

19 changes: 0 additions & 19 deletions tests/bson/bson-fromJSON-003.phpt

This file was deleted.

Loading