[ Index ]

PHP Cross Reference of phpBB-3.3.3-deutsch




/vendor/symfony/http-foundation/Session/Storage/Handler/ -> MongoDbSessionHandler.php (summary)

(no description)

File Size: 255 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

MongoDbSessionHandler:: (10 methods):

Class: MongoDbSessionHandler  - X-Ref

Session handler using the mongodb/mongodb package and MongoDB driver extension.

__construct($mongo, array $options)   X-Ref

List of available options:
* database: The name of the database [required]
* collection: The name of the collection [required]
* id_field: The field name for storing the session id [default: _id]
* data_field: The field name for storing the session data [default: data]
* time_field: The field name for storing the timestamp [default: time]
* expiry_field: The field name for storing the expiry-timestamp [default: expires_at].

It is strongly recommended to put an index on the `expiry_field` for
garbage-collection. Alternatively it's possible to automatically expire
the sessions in the database as described below:

A TTL collections can be used on MongoDB 2.2+ to cleanup expired sessions
automatically. Such an index can for example look like this:

{ "<expiry-field>": 1 },
{ "expireAfterSeconds": 0 }

More details on: https://docs.mongodb.org/manual/tutorial/expire-data/

If you use such an index, you can drop `gc_probability` to 0 since
no garbage-collection is required.

param: \MongoDB\Client $mongo   A MongoDB\Client instance
param: array           $options An associative array of field options

close()   X-Ref

doDestroy($sessionId)   X-Ref

gc($maxlifetime)   X-Ref

doWrite($sessionId, $data)   X-Ref

updateTimestamp($sessionId, $data)   X-Ref

doRead($sessionId)   X-Ref

getCollection()   X-Ref
Return a "MongoCollection" instance.

return: \MongoCollection

getMongo()   X-Ref
Return a Mongo instance.

return: \Mongo|\MongoClient|\MongoDB\Client

createDateTime($seconds = null)   X-Ref
Create a date object using the class appropriate for the current mongo connection.

Return an instance of a MongoDate or \MongoDB\BSON\UTCDateTime

return: \MongoDate|\MongoDB\BSON\UTCDateTime
param: int $seconds An integer representing UTC seconds since Jan 1 1970.  Defaults to now.

Generated: Sun Feb 14 20:08:31 2021 Cross-referenced by PHPXref 0.7.1