Skip to content

Commit d79c528

Browse files
committed
Merge branch '4.0'
* 4.0: fix the handling of timestamp in the MongoDBSessionHandler Improve the documentation of `Finder::exclude()` [DI] Skip resource tracking if disabled [WebProfilerBundle] fix wrong variable for profiler counting ajax requests
2 parents d65c43b + fa8455a commit d79c528

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,11 @@ public function getReflectionClass(?string $class, bool $throw = true): ?\Reflec
326326
try {
327327
if (isset($this->classReflectors[$class])) {
328328
$classReflector = $this->classReflectors[$class];
329-
} else {
329+
} elseif ($this->trackResources) {
330330
$resource = new ClassExistenceResource($class, false);
331331
$classReflector = $resource->isFresh(0) ? false : new \ReflectionClass($class);
332+
} else {
333+
$classReflector = new \ReflectionClass($class);
332334
}
333335
} catch (\ReflectionException $e) {
334336
if ($throw) {

src/Symfony/Component/Finder/Finder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ public function size($size)
297297
/**
298298
* Excludes directories.
299299
*
300+
* Directories passed as argument must be relative to the ones defined with the `in()` method. For example:
301+
*
302+
* $finder->in(__DIR__)->exclude('ruby');
303+
*
300304
* @param string|array $dirs A directory path or an array of directories
301305
*
302306
* @return $this

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ protected function doWrite($sessionId, $data)
141141
*/
142142
public function updateTimestamp($sessionId, $data)
143143
{
144-
$expiry = $this->createDateTime(time() + (int) ini_get('session.gc_maxlifetime'));
144+
$expiry = new \MongoDB\BSON\UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
145145

146146
if ($this->mongo instanceof \MongoDB\Client) {
147147
$methodName = 'updateOne';
@@ -154,7 +154,7 @@ public function updateTimestamp($sessionId, $data)
154154
$this->getCollection()->$methodName(
155155
array($this->options['id_field'] => $sessionId),
156156
array('$set' => array(
157-
$this->options['time_field'] => $this->createDateTime(),
157+
$this->options['time_field'] => new \MongoDB\BSON\UTCDateTime(),
158158
$this->options['expiry_field'] => $expiry,
159159
)),
160160
$options

0 commit comments

Comments
 (0)