vkxp.install in VK CrossPoster 6
Same filename and directory in other branches
Requirements and uninstall functions for the vkxp module.
File
vkxp.installView source
<?php
/**
* @file
* Requirements and uninstall functions for the vkxp module.
*/
/**
* Implementation of hook_requirements()
*/
function vkxp_requirements($phase) {
$requirements = array();
// Ensure translations don't break at install time.
$t = get_t();
if ($phase == 'runtime') {
// Check for presence of curl support.
if (!function_exists('curl_init')) {
$requirements['vkxp_curl'] = array(
'title' => $t('cURL Support for VKontakte CrossPoster'),
'value' => $t('VKontakte CrossPoster requires <a href="http://php.net/manual/en/book.curl.php">cURL support in PHP</a> to function fully. Without this, contents will not be posted to vkontakte.'),
'severity' => REQUIREMENT_ERROR,
);
}
else {
$requirements['vkxp_curl'] = array(
'title' => $t('cURL Support for VKontakte CrossPoster'),
'value' => $t('cURL enabled'),
'severity' => REQUIREMENT_OK,
);
}
}
return $requirements;
}
/**
* Implementation of hook_uninstall()
*/
function vkxp_uninstall() {
db_query("DELETE FROM {variable} WHERE name LIKE 'vkxp_%'");
cache_clear_all('variables', 'cache');
}
Functions
Name | Description |
---|---|
vkxp_requirements | Implementation of hook_requirements() |
vkxp_uninstall | Implementation of hook_uninstall() |