Pull merge.
[yaffs-website] / web / modules / contrib / media_entity_actions / media_entity_actions.install
1 <?php
2
3 /**
4  * @file
5  * Install, uninstall and update hooks for Media Entity Actions module.
6  */
7
8 /**
9  * Implements hook_requirements().
10  */
11 function media_entity_actions_requirements($phase) {
12   $requirements = [];
13
14   // Prevent installation if Media Entity 1.x is enabled.
15   if (\Drupal::moduleHandler()->moduleExists('media_entity')) {
16     $info = system_get_info('module', 'media_entity');
17     if (version_compare($info['version'], '8.x-2') < 0) {
18       $requirements['media_entity_generic_incompatibility'] = [
19         'title' => t('Media'),
20         'description' => t('The Media Entity Actions module is not compatible with contrib <a href=":url">Media Entity</a> 1.x branch. You don\'t need to enable this module manually, when performing the upgrade to Media in core, this module will be automatically enabled.', [
21           ':url' => 'https://drupal.org/project/media_entity',
22         ]),
23         'severity' => REQUIREMENT_ERROR,
24       ];
25     }
26   }
27
28   return $requirements;
29 }