HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/fabricas.colombiatrade.com.co/public_html/modules/contrib/metatag/metatag.install
<?php

/**
 * @file
 * Requirements and update functions for the Metatag module.
 */

/**
 * Implements hook_requirements().
 */
function metatag_requirements($phase) {
  $requirements = [];

  if ($phase == 'runtime') {
    // Note that no meta tags will be output while the site is in maintenance
    // mode.
    if (\Drupal::state()->get('system.maintenance_mode')) {
      $requirements['metatag_maintenance_mode'] = [
        'severity' => REQUIREMENT_WARNING,
        'title' => 'Metatag',
        'value' => t('Not enabled while in maintenance mode'),
        'description' => t('Please note that while the site is in maintenance mode none of the usual meta tags will be output.'),
      ];
    }

    // Recommend the Schema.org Metatag module.
    if (!\Drupal::moduleHandler()->moduleExists('schema_metatag')) {
      $requirements['metatag_schema'] = [
        'severity' => REQUIREMENT_INFO,
        'title' => 'Metatag',
        'value' => t('Schema.org Metatag is recommended'),
        'description' => t('The <a href="@module">Schema.org Metatag</a> module is highly recommended to add <a href="@jsonld">JSON-LD</a> -formatted <a href="@schema">schema.org</a> compatible data structures to the site.', [
          '@module' => 'https://www.drupal.org/project/schema_metatag',
          '@jsonld' => 'https://json-ld.org',
          '@schema' => 'https://schema.org',
        ]),
      ];
    }
    else {
      $requirements['metatag_schema'] = [
        'severity' => REQUIREMENT_OK,
        'title' => 'Metatag',
        'value' => t('Schema.org Metatag is installed'),
        'description' => t('The <a href="@module">Schema.org Metatag</a> module is installed.', [
          '@module' => 'https://www.drupal.org/project/schema_metatag',
        ]),
      ];
    }
  }

  return $requirements;
}

/**
 * Implements hook_update_last_removed().
 */
function metatag_update_last_removed() {
  return 8106;
}

/**
 * Enable the new metatag_open_graph module.
 */
function metatag_update_8107() {
  \Drupal::service('module_installer')->install(['metatag_open_graph']);
  return (string) t("The new Metatag: Open Graph module has been enabled.");
}

/**
 * Need to clear caches after updating from 8.x-1.12.
 */
function metatag_update_8108() {
  return (string) t("The sites's caches will need to be rebuild to ensure Metatag works as intended.");
}