feature #24438 [Session][VarDumper] Deprecate accepting legacy mongo extension (Tobion)
This PR was squashed before being merged into the 3.4 branch (closes #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 -------d535ff60c2
[VarDumper] deprecate MongoCaster6651af07c2
[HttpFoundation] deprecate using with the legacy mongo extension; use it with the mongodb/mongodb package and ext-mongodb instead
This commit is contained in:
commit
ee9786ac9e
@ -240,6 +240,9 @@ HttpFoundation
|
|||||||
* `NativeSessionStorage::setSaveHandler()` now takes an instance of `\SessionHandlerInterface` as argument.
|
* `NativeSessionStorage::setSaveHandler()` now takes an instance of `\SessionHandlerInterface` as argument.
|
||||||
Not passing it is deprecated and will throw a `TypeError` in 4.0.
|
Not passing it is deprecated and will throw a `TypeError` in 4.0.
|
||||||
|
|
||||||
|
* Using `Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler` with the legacy mongo extension
|
||||||
|
has been deprecated and will be removed in 4.0. Use it with the mongodb/mongodb package and ext-mongodb instead.
|
||||||
|
|
||||||
HttpKernel
|
HttpKernel
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
@ -542,6 +542,9 @@ HttpFoundation
|
|||||||
|
|
||||||
* `NativeSessionStorage::setSaveHandler()` now requires an instance of `\SessionHandlerInterface` as argument.
|
* `NativeSessionStorage::setSaveHandler()` now requires an instance of `\SessionHandlerInterface` as argument.
|
||||||
|
|
||||||
|
* The `Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler` does not work with the legacy
|
||||||
|
mongo extension anymore. It requires mongodb/mongodb package and ext-mongodb.
|
||||||
|
|
||||||
HttpKernel
|
HttpKernel
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ CHANGELOG
|
|||||||
* deprecated the `NativeSessionHandler` class,
|
* deprecated the `NativeSessionHandler` class,
|
||||||
* deprecated the `AbstractProxy`, `NativeProxy` and `SessionHandlerProxy` classes,
|
* deprecated the `AbstractProxy`, `NativeProxy` and `SessionHandlerProxy` classes,
|
||||||
* deprecated setting session save handlers that do not implement `\SessionHandlerInterface` in `NativeSessionStorage::setSaveHandler()`
|
* deprecated setting session save handlers that do not implement `\SessionHandlerInterface` in `NativeSessionStorage::setSaveHandler()`
|
||||||
|
* deprecated using `MongoDbSessionHandler` with the legacy mongo extension; use it with the mongodb/mongodb package and ext-mongodb instead
|
||||||
|
|
||||||
3.3.0
|
3.3.0
|
||||||
-----
|
-----
|
||||||
|
@ -12,7 +12,12 @@
|
|||||||
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
|
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Session handler using the mongodb/mongodb package and MongoDB driver extension.
|
||||||
|
*
|
||||||
* @author Markus Bachmann <markus.bachmann@bachi.biz>
|
* @author Markus Bachmann <markus.bachmann@bachi.biz>
|
||||||
|
*
|
||||||
|
* @see https://packagist.org/packages/mongodb/mongodb
|
||||||
|
* @see http://php.net/manual/en/set.mongodb.php
|
||||||
*/
|
*/
|
||||||
class MongoDbSessionHandler implements \SessionHandlerInterface
|
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
|
* If you use such an index, you can drop `gc_probability` to 0 since
|
||||||
* no garbage-collection is required.
|
* no garbage-collection is required.
|
||||||
*
|
*
|
||||||
* @param \Mongo|\MongoClient|\MongoDB\Client $mongo A MongoDB\Client, MongoClient or Mongo instance
|
* @param \MongoDB\Client $mongo A MongoDB\Client instance
|
||||||
* @param array $options An associative array of field options
|
* @param array $options An associative array of field options
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException When MongoClient or Mongo instance not provided
|
* @throws \InvalidArgumentException When MongoClient or Mongo instance not provided
|
||||||
* @throws \InvalidArgumentException When "database" or "collection" not provided
|
* @throws \InvalidArgumentException When "database" or "collection" not provided
|
||||||
*/
|
*/
|
||||||
public function __construct($mongo, array $options)
|
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)) {
|
if (!($mongo instanceof \MongoDB\Client || $mongo instanceof \MongoClient || $mongo instanceof \Mongo)) {
|
||||||
throw new \InvalidArgumentException('MongoClient or Mongo instance required');
|
throw new \InvalidArgumentException('MongoClient or Mongo instance required');
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ CHANGELOG
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
* added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth
|
* added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth
|
||||||
|
* deprecated `MongoCaster`
|
||||||
|
|
||||||
2.7.0
|
2.7.0
|
||||||
-----
|
-----
|
||||||
|
@ -13,10 +13,14 @@ namespace Symfony\Component\VarDumper\Caster;
|
|||||||
|
|
||||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
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.
|
* Casts classes from the MongoDb extension to array representation.
|
||||||
*
|
*
|
||||||
* @author Nicolas Grekas <p@tchwork.com>
|
* @author Nicolas Grekas <p@tchwork.com>
|
||||||
|
*
|
||||||
|
* @deprecated since version 3.4, to be removed in 4.0.
|
||||||
*/
|
*/
|
||||||
class MongoCaster
|
class MongoCaster
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user