BibciteRisServiceProvider.php in Bibliography & Citation 8
Same filename and directory in other branches
Namespace
Drupal\bibcite_risFile
modules/bibcite_ris/src/BibciteRisServiceProvider.phpView source
<?php
namespace Drupal\bibcite_ris;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
/**
* Adds RIS as known format.
*/
class BibciteRisServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
if ($container
->has('http_middleware.negotiation')) {
$definition = $container
->getDefinition('http_middleware.negotiation');
if (is_a($definition
->getClass(), '\\Drupal\\Core\\StackMiddleware\\NegotiationMiddleware', TRUE)) {
$definition
->addMethodCall('registerFormat', [
'ris',
[
'text/plain',
'application/x-research-info-systems',
],
]);
}
}
}
}
Classes
Name | Description |
---|---|
BibciteRisServiceProvider | Adds RIS as known format. |