SophronGuesserServiceProvider.php in Sophron 8
Namespace
Drupal\sophron_guesserFile
sophron_guesser/src/SophronGuesserServiceProvider.phpView source
<?php
namespace Drupal\sophron_guesser;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
use Symfony\Component\DependencyInjection\Reference;
/**
* Modifies the "file.mime_type.guesser.extension" service.
*/
class SophronGuesserServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
// Overrides "file.mime_type.guesser.extension" to use Sophron.
$definition = $container
->getDefinition('file.mime_type.guesser.extension');
$definition
->setClass(SophronMimeTypeGuesser::class)
->setArguments([
new Reference('sophron.mime_map.manager'),
new Reference('file_system'),
]);
}
}
Classes
Name | Description |
---|---|
SophronGuesserServiceProvider | Modifies the "file.mime_type.guesser.extension" service. |