'_provision_stats', 'description' => 'Return statistics from a running site.' ); return $items; } function _provision_stats($url) { if (!_provision_drupal_site_installed($url)) { provision_log("error", "Site has not been installed yet."); provision_set_error(PROVISION_SITE_NOT_FOUND); provision_output($url, $data); } $data = provision_get_site_data($url); $rolled_back = provision_invoke("stats", $url, $data); //needs to be done on active database $modules = module_implements('provision_stats'); drupal_get_messages(); //clear the messages being saved so far. // Change headers and db info, also backs up to restore later _provision_drupal_switch_active_site($url); //TODO: add some required modules here, possibly update_status if not enabled. //Load the modules from the hosted site #module_list(TRUE); $stats['node_count'] = db_result(db_query("select max(nid) from {node}")); $stats['user_count'] = db_result(db_query("select max(uid) from {users}")); foreach ($modules as $name) { $func = $name .'_provision_stats'; $stats = array_merge($stats, $func($url, $data)); } _provision_drupal_switch_active_site(); module_list(TRUE); return provision_output($url, $data, array('stats' => $stats)); }