postmark.install in Postmark 7
Same filename and directory in other branches
PostMark installation functions.
File
postmark.installView source
<?php
/**
* @file
* PostMark installation functions.
*/
/**
* Implementation of hook_uninstall().
*/
function postmark_uninstall() {
// Remove the SMTP library value
if (strpos(variable_get('smtp_library', ''), 'postmark')) {
variable_del('smtp_library');
}
variable_del('postmark_enabled');
variable_del('postmark_api_key');
}
/**
* Implementation of hook_enable().
*/
function postmark_enable() {
mailsystem_set(array(
'default-system' => 'PostmarkMailSystem',
));
}
/**
* Implementation of hook_disable().
*/
function postmark_disable() {
mailsystem_clear(array(
'default-system' => 'PostmarkMailSystem',
));
}
/**
* Implementation of hook_requirements().
*/
function postmark_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
if (($library = libraries_detect('postmark-php')) && !empty($library['installed'])) {
$requirements['postmark'] = array(
'title' => 'Postmark library',
'value' => $library['version'],
'severity' => REQUIREMENT_OK,
);
}
else {
$requirements['postmark'] = array(
'title' => 'Postmark',
'value' => t('Postmark PHP external library not installed. See module README file for instructions.'),
'severity' => REQUIREMENT_ERROR,
'weight' => -1,
);
}
}
return $requirements;
}
Functions
Name | Description |
---|---|
postmark_disable | Implementation of hook_disable(). |
postmark_enable | Implementation of hook_enable(). |
postmark_requirements | Implementation of hook_requirements(). |
postmark_uninstall | Implementation of hook_uninstall(). |