forked from symfony/symfony
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature symfony#24438 [Session][VarDumper] Deprecate accepting legacy…
… mongo extension (Tobion) This PR was squashed before being merged into the 3.4 branch (closes symfony#24438). Discussion ---------- [Session][VarDumper] Deprecate accepting legacy mongo extension | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | The old ext-mongo is deprecated and does not work with PHP 7. See http://php.net/manual/en/mongo.setup.php People should use mongodb/mongodb and ext-mongodb instead. This deprecates functionality using the old ext-mongo classes. Commits ------- d535ff6 [VarDumper] deprecate MongoCaster 6651af0 [HttpFoundation] deprecate using with the legacy mongo extension; use it with the mongodb/mongodb package and ext-mongodb instead
- Loading branch information
Showing
6 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,12 @@ | |
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; | ||
|
||
/** | ||
* Session handler using the mongodb/mongodb package and MongoDB driver extension. | ||
* | ||
* @author Markus Bachmann <[email protected]> | ||
* | ||
* @see https://packagist.org/packages/mongodb/mongodb | ||
* @see http://php.net/manual/en/set.mongodb.php | ||
*/ | ||
class MongoDbSessionHandler implements \SessionHandlerInterface | ||
{ | ||
|
@@ -57,14 +62,18 @@ class MongoDbSessionHandler implements \SessionHandlerInterface | |
* If you use such an index, you can drop `gc_probability` to 0 since | ||
* no garbage-collection is required. | ||
* | ||
* @param \Mongo|\MongoClient|\MongoDB\Client $mongo A MongoDB\Client, MongoClient or Mongo instance | ||
* @param array $options An associative array of field options | ||
* @param \MongoDB\Client $mongo A MongoDB\Client instance | ||
* @param array $options An associative array of field options | ||
* | ||
* @throws \InvalidArgumentException When MongoClient or Mongo instance not provided | ||
* @throws \InvalidArgumentException When "database" or "collection" not provided | ||
*/ | ||
public function __construct($mongo, array $options) | ||
{ | ||
if ($mongo instanceof \MongoClient || $mongo instanceof \Mongo) { | ||
@trigger_error(sprintf('Using %s with the legacy mongo extension is deprecated as of 3.4 and will be removed in 4.0. Use it with the mongodb/mongodb package and ext-mongodb instead.', __CLASS__), E_USER_DEPRECATED); | ||
} | ||
|
||
if (!($mongo instanceof \MongoDB\Client || $mongo instanceof \MongoClient || $mongo instanceof \Mongo)) { | ||
throw new \InvalidArgumentException('MongoClient or Mongo instance required'); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,14 @@ | |
|
||
use Symfony\Component\VarDumper\Cloner\Stub; | ||
|
||
@trigger_error('The '.__NAMESPACE__.'\MongoCaster class is deprecated since version 3.4 and will be removed in 4.0.', E_USER_DEPRECATED); | ||
|
||
/** | ||
* Casts classes from the MongoDb extension to array representation. | ||
* | ||
* @author Nicolas Grekas <[email protected]> | ||
* | ||
* @deprecated since version 3.4, to be removed in 4.0. | ||
*/ | ||
class MongoCaster | ||
{ | ||
|