2006-07-13 13:14:25 +00:00
<?php
2009-05-13 19:42:18 +00:00
/**
* @file
* Install, update and uninstall functions for the aggregator module.
*/
2012-11-30 01:26:33 +00:00
/**
* Implements hook_requirements().
*/
function aggregator_requirements($phase) {
$has_curl = function_exists('curl_init');
2017-03-04 01:20:24 +00:00
$requirements = [];
$requirements['curl'] = [
2013-06-17 13:35:07 +00:00
'title' => t('cURL'),
'value' => $has_curl ? t('Enabled') : t('Not found'),
2017-03-04 01:20:24 +00:00
];
2012-11-30 01:26:33 +00:00
if (!$has_curl) {
$requirements['curl']['severity'] = REQUIREMENT_ERROR;
Issue #2474017 by pguillard, Cameron Tod, subhojit777, BQari, casivaagustin, colorfield, evgeny.chernyavskiy, wingmanjd, darol100, ifrik, jhodgdon, joshi.rohit100, Gábor Hojtsy, catch: Improve module description and error message about missing Curl library
2016-10-23 22:27:11 +00:00
$requirements['curl']['description'] = t('The Aggregator module requires the <a href="https://secure.php.net/manual/en/curl.setup.php">PHP cURL library</a>. For more information, see the <a href="https://www.drupal.org/requirements/php/curl">online information on installing the PHP cURL extension</a>.');
2012-11-30 01:26:33 +00:00
}
return $requirements;
}
2015-10-30 22:48:31 +00:00
/**
* The simple presence of this update function clears cached field definitions.
*/
function aggregator_update_8001() {
// Feed ID base field is now required.
}
2017-01-17 12:57:45 +00:00
/**
* Make the 'Source feed' field for aggregator items required.
*/
function aggregator_update_8200() {
// aggregator_update_8001() did not update the last installed field storage
// definition for the aggregator item's 'Source feed' field.
$definition_update_manager = \Drupal::entityDefinitionUpdateManager();
$field_definition = $definition_update_manager->getFieldStorageDefinition('fid', 'aggregator_item');
$field_definition->setRequired(TRUE);
$definition_update_manager->updateFieldStorageDefinition($field_definition);
}