use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
+use Wikimedia\Rdbms\Database;
/**
* This class generates message blobs for use by ResourceLoader modules.
foreach ( $modules as $name => $module ) {
$key = $cacheKeys[$name];
if ( !isset( $result[$key] ) || $curTTLs[$key] === null || $curTTLs[$key] < 0 ) {
- $this->logger->info( 'Message blob cache-miss for {module}',
- [ 'module' => $name, 'cacheKey' => $key ]
- );
$blobs[$name] = $this->recacheMessageBlob( $key, $module, $lang );
} else {
// Use unexpired cache
}
$json = FormatJson::encode( (object)$messages );
+ // @codeCoverageIgnoreStart
if ( $json === false ) {
$this->logger->warning( 'Failed to encode message blob for {module} ({lang})', [
'module' => $module->getName(),
] );
$json = '{}';
}
+ // codeCoverageIgnoreEnd
return $json;
}
}