You are here

function xhprof_mongodb_requirements in XHProf 6

Same name and namespace in other branches
  1. 8 modules/xhprof_mongodb/xhprof_mongodb.install \xhprof_mongodb_requirements()
  2. 7 modules/xhprof_mongodb/xhprof_mongodb.install \xhprof_mongodb_requirements()

@file Install, update and uninstall functions for the XHProf module.

File

modules/xhprof_mongodb/xhprof_mongodb.install, line 7
Install, update and uninstall functions for the XHProf module.

Code

function xhprof_mongodb_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time
  $t = get_t();
  if (extension_loaded('mongo')) {
    module_load_include('module', 'mongodb');
    $mongo = mongodb();
    if (!$mongo instanceof MongoDB) {
      $requirements['xhprof_mongodb'] = array(
        'title' => $t('Mongodb'),
        'value' => $t('Not running'),
        'description' => $t('Unable to get a Mongodb collection object. This is required to create indexes on install.'),
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}