'MySQL' => CRM_CORE_DAO::singleValueQuery('SELECT VERSION()'),
'communityMessagesUrl' => Civi::settings()->get('communityMessagesUrl'),
);
+ $this->getDomainStats();
$this->getPayProcStats();
$this->getEntityStats();
$this->getExtensionStats();
'CRM_Member_DAO_MembershipBlock' => 'is_active = 1',
'CRM_Pledge_DAO_Pledge' => 'is_test = 0',
'CRM_Pledge_DAO_PledgeBlock' => NULL,
+ 'CRM_Mailing_Event_DAO_Delivered' => NULL,
);
foreach ($tables as $daoName => $where) {
$dao = new $daoName();
}
}
+ /**
+ * Fetch stats about domain and add to 'stats' array.
+ */
+ private function getDomainStats() {
+ // Start with default value NULL, then check to see if there's a better
+ // value to be had.
+ $this->stats['domain_isoCode'] = NULL;
+ $params = array(
+ 'id' => CRM_Core_Config::domainID(),
+ );
+ $domain_result = civicrm_api3('domain', 'getsingle', $params);
+ if (!empty($domain_result['contact_id'])) {
+ $address_params = array(
+ 'contact_id' => $domain_result['contact_id'],
+ 'is_primary' => 1,
+ 'sequential' => 1,
+ );
+ $address_result = civicrm_api3('address', 'get', $address_params);
+ if ($address_result['count'] == 1 && !empty($address_result['values'][0]['country_id'])) {
+ $country_params = array(
+ 'id' => $address_result['values'][0]['country_id'],
+ );
+ $country_result = civicrm_api3('country', 'getsingle', $country_params);
+ if (!empty($country_result['iso_code'])) {
+ $this->stats['domain_isoCode'] = $country_result['iso_code'];
+ }
+ }
+ }
+ }
+
/**
* Send the request to civicrm.org
* Store results in the cache file