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

Drupal example source code file (poormanscron.install)

This example Drupal source code file (poormanscron.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

3600, 60, array, function, interval, math, max, php, poormanscron_uninstall, poormanscron_update_6200, poormanscron_update_6201, return

The poormanscron.install Drupal example source code

<?php
// $Id: poormanscron.install,v 1.2.2.6 2010/01/17 00:23:12 davereid Exp $

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

/**
 * Implements hook_uninstall().
 */
function poormanscron_uninstall() {
  variable_del('poormanscron_interval');
  variable_del('poormanscron_retry_interval');
  variable_del('poormanscron_log_cron_runs');
  variable_del('cron_safe_threshold');
  variable_del('cron_threshold_semaphore');
}

/**
 * Upgrade to the D7 variable names for easy transition.
 */
function poormanscron_update_6200() {
  $interval = variable_get('poormanscron_interval', 60) * 60;
  variable_set('cron_safe_threshold', max($interval, 3600));
  variable_del('poormanscron_interval');
  variable_del('poormanscron_retry_interval');
  variable_del('poormanscron_log_cron_runs');
  return array();
}

/**
 * JavaScript variable names have changed.
 */
function poormanscron_update_6201() {
  return array();
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal poormanscron.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.