You are here

oembed.install in oEmbed 7.0

Same filename and directory in other branches
  1. 7 oembed.install

File

oembed.install
View source
<?php

/**
 * Implementation of hook_schema().
 */
function oembed_schema() {
  $schema['oembed_provider'] = _oembed_provider_schema_1();
  $schema['cache_oembed'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_oembed']['description'] = 'Cache table for the oEmbed module.';
  return $schema;
}
function _oembed_provider_schema_1() {
  return array(
    'export' => array(
      'identifier' => 'provider',
      'primary key' => 'pid',
      'bulk export' => TRUE,
      'default hook' => 'default_oembed_provider',
      'api' => array(
        'owner' => 'oembed',
        'api' => 'oembed_provider',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'pid' => array(
        'type' => 'serial',
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'description' => 'Unique ID for this subtask. Used to identify it programmatically.',
        'not null' => TRUE,
        'default' => '',
      ),
      'title' => array(
        'description' => 'The human-readable title of the provider.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'endpoint' => array(
        'type' => 'varchar',
        'length' => 255,
        'description' => 'The endpoint for this provider.',
        'not null' => TRUE,
        'default' => '',
      ),
      'scheme' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Line separated scheme definition.',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => '',
      ),
    ),
    'primary key' => array(
      'pid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
}

/**
 * Rename extant oembed filters to oembed_legacy.
 */
function oembed_update_7000(&$sandbox) {
  db_update('filter')
    ->fields(array(
    'name' => 'oembed_legacy',
  ))
    ->condition('name', 'oembed')
    ->execute();
}

/**
 * Disable and uninstall oEmbed core.
 */
function oembed_update_7001() {
  module_disable(array(
    'oembedcore',
  ));
  drupal_uninstall_modules(array(
    'oembedcore',
  ));
}

Functions

Namesort descending Description
oembed_schema Implementation of hook_schema().
oembed_update_7000 Rename extant oembed filters to oembed_legacy.
oembed_update_7001 Disable and uninstall oEmbed core.
_oembed_provider_schema_1