| 1 |
<?php
|
| 2 |
// $Id: simplepie.install,v 1.1 2008/04/23 17:16:30 mustafau Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
*/
|
| 7 |
|
| 8 |
/**
|
| 9 |
* Implement hook_uninstall().
|
| 10 |
*/
|
| 11 |
function simplepie_uninstall() {
|
| 12 |
variable_del('simplepie_cache_location');
|
| 13 |
}
|
| 14 |
|
| 15 |
/**
|
| 16 |
* Implement hook_requirements().
|
| 17 |
*/
|
| 18 |
function simplepie_requirements($phase) {
|
| 19 |
$requirements = array();
|
| 20 |
// Ensure translations don't break at install time.
|
| 21 |
$t = get_t();
|
| 22 |
|
| 23 |
switch ($phase) {
|
| 24 |
case 'runtime':
|
| 25 |
$requirements['simplepie'] = array('title' => $t('SimplePie library'));
|
| 26 |
|
| 27 |
$library = simplepie_get_library_path();
|
| 28 |
if (file_exists($library)) {
|
| 29 |
simplepie_require();
|
| 30 |
}
|
| 31 |
|
| 32 |
if (defined('SIMPLEPIE_VERSION')) {
|
| 33 |
$requirements['simplepie']['severity'] = REQUIREMENT_OK;
|
| 34 |
$requirements['simplepie']['value'] = SIMPLEPIE_VERSION;
|
| 35 |
}
|
| 36 |
else {
|
| 37 |
$requirements['simplepie']['description'] = $t('The <a href="@url" target="_blank">SimplePie</a> library was not found.', array('@url' => 'http://simplepie.org'));
|
| 38 |
$requirements['simplepie']['severity'] = REQUIREMENT_WARNING;
|
| 39 |
$requirements['simplepie']['value'] = $t('Not installed.');
|
| 40 |
}
|
| 41 |
}
|
| 42 |
return $requirements;
|
| 43 |
}
|