public static function write()
{
if (self::hasWriteLock()) {
return;
}
$processedKeys = [];
foreach (self::$saveStack as $conf) {
if (in_array($conf[1], $processedKeys)) {
continue;
}
try {
forward_static_call_array([__CLASS__, "storeToCache"], $conf);
} catch (\Exception $e) {
Logger::error("Unable to put element " . $conf[1] . " to cache because of the following reason: ");
Logger::error($e);
}
$processedKeys[] = $conf[1];
// index 1 is the key for the cache item
}
// reset
self::$saveStack = [];
}