Closed
Description
If the RedisSimpleLock is used in webserver environments, it will probably most of the time produce a fatal error, because the pctnl extension is not compiled in to webserver's php modules.
It is used just once to register a shutdown function for the SIGINT in the constructor, which makes sense if we want to catch a cli execution and a pressed CTRL-C for example. But that prevents usage when the pcntl extension is not available.
Better
public function __construct($identifier, Client $client, $ttl = 10000, LoggerInterface $logger = null)
{
$this->identifier = $identifier;
$this->client = $client;
$this->ttl = $ttl;
$this->logger = $logger ?: new NullLogger;
$this->id = mt_rand();
register_shutdown_function($closure = $this->releaseClosure());
if (function_exists('pcntl_signal')) {
pcntl_signal(SIGINT, $closure);
}
}
Metadata
Metadata
Assignees
Labels
No labels