home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (xmlsitemap_engines.install)

This example Drupal source code file (xmlsitemap_engines.install) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

array, array_diff, engines, following, function, have, implode, list, moreover, php, ping, removed, sitemap, xmlsitemap_engines_uninstall

The xmlsitemap_engines.install Drupal example source code

<?php
// $Id: xmlsitemap_engines.install,v 1.8 2011/02/09 22:23:32 davereid Exp $

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

/**
 * Implements hook_install().
 */
function xmlsitemap_engines_install() {
  // Set this module's weight to 1 so xmlsitemap_engines_cron() runs after
  // the sitemap has been generated in xmlsitemap_cron().
  db_update('system')
    ->fields(array('weight' => 2))
    ->condition('type', 'module')
    ->condition('name', 'xmlsitemap_engines')
    ->execute();
}

/**
 * Implements hook_uninstall().
 */
function xmlsitemap_engines_uninstall() {
  variable_del('xmlsitemap_engines_engines');
  variable_del('xmlsitemap_engines_custom_urls');
  variable_del('xmlsitemap_engines_minimum_lifetime');
  variable_del('xmlsitemap_engines_submit_last');
  variable_del('xmlsitemap_engines_submit_updated');
}

/**
 * Deprecate support for Ask.com, Moreover, and Yahoo! search engines.
 */
function xmlsitemap_engines_update_6202() {
  $engines = variable_get('xmlsitemap_engines_engines', array());
  $removed = array(
    'ask' => 'Ask.com',
    'moreover' => 'Moreover',
    'yahoo' => 'Yahoo.com',
  );
  $engines = array_diff($engines, array_keys($removed));
  variable_set('xmlsitemap_engines_engines', $engines);
  return t('The following search engines have deprecated their XML sitemap ping services and have been disabled: !list.', array('!list' => implode(', ', $removed)));
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal xmlsitemap_engines.install source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.