Skip to content

Commit f3ae7ec

Browse files
committed
minor #176 Use "more entropy" option when using uniqid() function (javiereguiluz)
This PR was merged into the 2.x-dev branch. Discussion ---------- Use "more entropy" option when using uniqid() function As you can see in [the source code of the PHP uniqid() function](https://github.com/php/php-src/blob/1c295d4a9ac78fcc2f77d6695987598bb7abcb83/ext/standard/uniqid.c#L68) when you don't pass `true` as the second argument, PHP sleeps the application for 1 microsecond (`usleep(1)`) Symfony uses `true` almost everywhere, but this bundle still had some uniqid() calls without this option. Commits ------- 2f52c4e Use "more entropy" option when usin uniqid() function
2 parents bbce386 + 2f52c4e commit f3ae7ec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

DependencyInjection/MonologExtension.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
182182
$handler['publisher']['port'],
183183
$handler['publisher']['chunk_size'],
184184
));
185-
$transportId = uniqid('monolog.gelf.transport.');
185+
$transportId = uniqid('monolog.gelf.transport.', true);
186186
$transport->setPublic(false);
187187
$container->setDefinition($transportId, $transport);
188188

189189
$publisher = new Definition('%monolog.gelfphp.publisher.class%', array());
190190
$publisher->addMethodCall('addTransport', array(new Reference($transportId)));
191-
$publisherId = uniqid('monolog.gelf.publisher.');
191+
$publisherId = uniqid('monolog.gelf.publisher.', true);
192192
$publisher->setPublic(false);
193193
$container->setDefinition($publisherId, $publisher);
194194
} elseif (class_exists('Gelf\MessagePublisher')) {
@@ -198,7 +198,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
198198
$handler['publisher']['chunk_size'],
199199
));
200200

201-
$publisherId = uniqid('monolog.gelf.publisher.');
201+
$publisherId = uniqid('monolog.gelf.publisher.', true);
202202
$publisher->setPublic(false);
203203
$container->setDefinition($publisherId, $publisher);
204204
} else {
@@ -228,7 +228,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
228228
$server,
229229
));
230230

231-
$clientId = uniqid('monolog.mongo.client.');
231+
$clientId = uniqid('monolog.mongo.client.', true);
232232
$client->setPublic(false);
233233
$container->setDefinition($clientId, $client);
234234
}
@@ -269,7 +269,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
269269
$elasticaClientArguments
270270
));
271271

272-
$clientId = uniqid('monolog.elastica.client.');
272+
$clientId = uniqid('monolog.elastica.client.', true);
273273
$elasticaClient->setPublic(false);
274274
$container->setDefinition($clientId, $elasticaClient);
275275
}

0 commit comments

Comments
 (0)