HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.34
System: Linux atalantini.com 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64
User: root (0)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: /var/www/html/drupal/pagina46_zoom/pagina46_zoom.install
<?php

/**
 * @file
 * Install, update and uninstall functions for the pagina46_zoom module.
 */

/**
 * Implements hook_install().
 */
function pagina46_zoom_install() {
  \Drupal::messenger()->addStatus(__FUNCTION__);
}

/**
 * Implements hook_uninstall().
 */
function pagina46_zoom_uninstall() {
  \Drupal::messenger()->addStatus(__FUNCTION__);
}

/**
 * Implements hook_schema().
 */
function pagina46_zoom_schema() {
  $schema['pagina46_zoom_registrations'] = [
    'description' => 'Tabella registrazioni.',
    'fields' => [
      'id' => [
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique record ID.',
      ],
      'type' => [
        'type' => 'varchar_ascii',
        'length' => 5,
        'not null' => TRUE,
        'default' => '',
        'description' => 'tipo di riunione meeting o webinar.',
      ],
      'mail' => [
        'type' => 'varchar_ascii',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Email dell utente registrato',
      ],
      'zoom_id' => [
        'type' => 'varchar_ascii',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ],
      'zoom_registration_id' => [
        'type' => 'varchar_ascii',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ]
    ],
    'primary key' => ['id'],
    'indexes' => [
      'type' => ['mail'],
    ],
  ];

  return $schema;
}

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

  if ($phase == 'runtime') {
    $value = mt_rand(0, 100);
    $requirements['pagina46_zoom_status'] = [
      'title' => t('pagina46_zoom status'),
      'value' => t('pagina46_zoom value: @value', ['@value' => $value]),
      'severity' => $value > 50 ? REQUIREMENT_INFO : REQUIREMENT_WARNING,
    ];
  }

  return $requirements;
}