simplenews_statistics_encoder.install in Simplenews Statistics 7
Same filename and directory in other branches
Simplenews statistics encoder (un)install and updates file.
File
simplenews_statistics_encoder/simplenews_statistics_encoder.installView source
<?php
/**
* @file
* Simplenews statistics encoder (un)install and updates file.
*/
/**
* Implements hook_install().
*/
function simplenews_statistics_encoder_install() {
// Generate a very random number as salt.
$min = rand(0, 100);
$max = rand($min, 1000);
$salt = rand($min, $max);
variable_set('simplenews_statistics_encoder_salt', $salt);
// Generate a 32 character identifier (a 128 bit hex number).
$key = md5(uniqid(rand()));
variable_set('simplenews_statistics_encoder_private_key', $key);
}
/**
* Implements hook_uninstall().
*/
function simplenews_statistics_encoder_uninstall() {
variable_del('simplenews_statistics_encoder_salt');
}
Functions
Name | Description |
---|---|
simplenews_statistics_encoder_install | Implements hook_install(). |
simplenews_statistics_encoder_uninstall | Implements hook_uninstall(). |