You are here

function performance_requirements in Devel 5

File

performance/performance.install, line 81

Code

function performance_requirements($phase) {
  $requirements = array();
  if ($phase != 'runtime') {
    return $requirements;
  }
  if (variable_get('performance_detail', 0)) {
    $requirements['performance_detail'] = array(
      'title' => t('Performance logging details'),
      'value' => 'Enabled',
      'severity' => REQUIREMENT_WARNING,
      'description' => t('Performance detailed logging is <a href="@link">enabled</a>. This can cause severe issues on live sites.', array(
        '@link' => url('admin/settings/performance_logging'),
      )),
    );
  }
  if (variable_get('dev_query', 0)) {
    if (variable_get('performance_detail', 0) || variable_get('performance_summary_db', 0) || variable_get('performance_summary_apc', 0)) {
      $requirements['performance_query'] = array(
        'title' => t('Performance logging query'),
        'value' => 'Enabled',
        'severity' => REQUIREMENT_WARNING,
        'description' => t('Query timing and count logging is <a href="@link">enabled</a>. This can cause memory size per page to be larger than normal.', array(
          '@link' => url('admin/settings/performance_logging'),
        )),
      );
    }
  }
  if (!function_exists('apc_fetch')) {
    $requirements['performance_apc'] = array(
      'title' => t('Performance logging APC'),
      'value' => 'Disabled',
      'severity' => REQUIREMENT_WARNING,
      'description' => t('Performance logging on live web sites works best if APC is enabled.'),
    );
  }
  $shm_size = ini_get('apc.shm_size');
  if ($shm_size < 48) {
    $requirements['performance_apc_mem'] = array(
      'title' => t('Performance logging APC memory size'),
      'value' => $shm_size,
      'severity' => REQUIREMENT_WARNING,
      'description' => t('APC has been configured for !size, which is less than the recommended 48 MB of memory. If you encounter errors when viewing the summary report, then try to increase that limit for APC.', array(
        '!size' => $shm_size,
      )),
    );
  }
  return $requirements;
}