function views_data_export_requirements in Views data export 6.2
Same name and namespace in other branches
- 7.4 views_data_export.install \views_data_export_requirements()
- 7.3 views_data_export.install \views_data_export_requirements()
Implements hook_requirements().
File
- ./
views_data_export.install, line 136
Code
function views_data_export_requirements($phase) {
global $db_type;
$requirements = array();
// Ensure translations don't break at install time
$t = get_t();
switch ($phase) {
case 'runtime':
switch ($db_type) {
case 'mysql':
case 'mysqli':
// Check the max allowed packet size.
$max_allowed_packet = db_result(db_query("SHOW VARIABLES WHERE variable_name = '%s'", array(
'max_allowed_packet',
)));
if (is_numeric($max_allowed_packet)) {
if ($max_allowed_packet < 16 * 1024 * 1024) {
$requirements['views_data_export'] = array(
'title' => $t('MySQL - max allowed packet'),
'value' => format_size($max_allowed_packet),
'description' => $t("Your MySQL 'max_allowed_packet' setting may be too low for Views data export to function correctly, Drupal's requirements recommend setting it to at least 16M. See: !link", array(
'!link' => l('http://drupal.org/requirements', 'http://drupal.org/requirements'),
)),
'severity' => REQUIREMENT_WARNING,
);
}
}
break;
}
break;
}
return $requirements;
}