Merge branch '2.8' into 3.3
* 2.8: bumped Symfony version to 2.7.36 updated VERSION for 2.7.35 update CONTRIBUTORS for 2.7.35 updated CHANGELOG for 2.7.35 [Session] fix MongoDb session handler to gc all expired sessions
This commit is contained in:
commit
307ddb92a4
@ -118,7 +118,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
|||||||
*/
|
*/
|
||||||
public function gc($maxlifetime)
|
public function gc($maxlifetime)
|
||||||
{
|
{
|
||||||
$methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove';
|
$methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteMany' : 'remove';
|
||||||
|
|
||||||
$this->getCollection()->$methodName(array(
|
$this->getCollection()->$methodName(array(
|
||||||
$this->options['expiry_field'] => array('$lt' => $this->createDateTime()),
|
$this->options['expiry_field'] => array('$lt' => $this->createDateTime()),
|
||||||
|
@ -285,7 +285,7 @@ class MongoDbSessionHandlerTest extends TestCase
|
|||||||
->with($this->options['database'], $this->options['collection'])
|
->with($this->options['database'], $this->options['collection'])
|
||||||
->will($this->returnValue($collection));
|
->will($this->returnValue($collection));
|
||||||
|
|
||||||
$methodName = phpversion('mongodb') ? 'deleteOne' : 'remove';
|
$methodName = phpversion('mongodb') ? 'deleteMany' : 'remove';
|
||||||
|
|
||||||
$collection->expects($this->once())
|
$collection->expects($this->once())
|
||||||
->method($methodName)
|
->method($methodName)
|
||||||
|
Reference in New Issue
Block a user