[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/modules/update/ -> update.install (source)

   1  <?php
   2  // $Id: update.install,v 1.4.2.3 2010/05/19 15:03:58 goba Exp $
   3  
   4  /**
   5   * Implementation of hook_install().
   6   */
   7  function update_install() {
   8    // Create cache table.
   9    drupal_install_schema('update');
  10    // Remove stale variables from update_status 5.x contrib, if any.
  11    _update_remove_update_status_variables();
  12  }
  13  
  14  /**
  15   * Implementation of hook_uninstall().
  16   */
  17  function update_uninstall() {
  18    // Remove cache table.
  19    drupal_uninstall_schema('update');
  20    // Clear any variables that might be in use
  21    $variables = array(
  22      'update_check_frequency',
  23      'update_fetch_url',
  24      'update_last_check',
  25      'update_notification_threshold',
  26      'update_notify_emails',
  27    );
  28    foreach ($variables as $variable) {
  29      variable_del($variable);
  30    }
  31  }
  32  
  33  /**
  34   * Implementation of hook_schema().
  35   */
  36  function update_schema() {
  37    $schema['cache_update'] = drupal_get_schema_unprocessed('system', 'cache');
  38    $schema['cache_update']['description'] = 'Cache table for the Update module to store information about available releases, fetched from central server.';
  39    return $schema;
  40  }
  41  
  42  /**
  43   * Private helper to clear out stale variables from update_status 5.x contrib.
  44   *
  45   * @see update_install()
  46   * @see update_update_6000()
  47   */
  48  function _update_remove_update_status_variables() {
  49    variable_del('update_status_settings');
  50    variable_del('update_status_notify_emails');
  51    variable_del('update_status_check_frequency');
  52    variable_del('update_status_notification_threshold');
  53    variable_del('update_status_last');
  54    variable_del('update_status_fetch_url');
  55  }
  56  
  57  /**
  58   * Clear out stale variables from update_status.
  59   */
  60  function update_update_6000() {
  61    _update_remove_update_status_variables();
  62    return array();
  63  }


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7