media_thumbnails_svg.install in Media Thumbnails SVG 8
Install, update and uninstall functions for the Media Thumbnails SVG module.
File
media_thumbnails_svg.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the Media Thumbnails SVG module.
*/
/**
* Implements hook_requirements().
*/
function media_thumbnails_svg_requirements($phase) {
$requirements = [];
if ($phase === 'runtime') {
switch (TRUE) {
case strpos(shell_exec('gm'), 'GraphicsMagick') !== FALSE:
$rasterizer = t('GraphicsMagick CLI tool detected. This should give you the best possible quality.');
break;
case strpos(shell_exec('convert'), 'ImageMagick') !== FALSE:
$rasterizer = t('ImageMagick CLI tool detected. Quality might be improved by installing the <a href="http://www.graphicsmagick.org">GraphicsMagick</a> CLI Tool.');
break;
default:
$rasterizer = t('PHP GD extension detected. Quality will be improved by installing the <a href="https://imagemagick.org">ImageMagick</a> or <a href="http://www.graphicsmagick.org">GraphicsMagick</a> CLI Tool.');
}
$requirements['rasterizer'] = [
'title' => t('Media Thumbnails SVG Rasterizer'),
'value' => $rasterizer,
'severity' => REQUIREMENT_INFO,
];
}
return $requirements;
}
Functions
Name | Description |
---|---|
media_thumbnails_svg_requirements | Implements hook_requirements(). |