function get_services_of_type($service_type) { $all_services = get_services(); $services = select_services($all_services, $service_type); if ($service_type === SR_SERVICE_TYPE::AGGREGATE_MANAGER) { // Sort the aggregates alphabetically by name usort($services, "agg_cmp"); } return $services; }
} if (!isset($sa_url)) { $sa_list = select_services($services, SR_SERVICE_TYPE::SLICE_AUTHORITY); if (count($sa_list) >= 0) { $sa = $sa_list[0]; $sa_url = $sa[SR_TABLE_FIELDNAME::SERVICE_URL]; } if (!isset($sa_url) || is_null($sa_url) || $sa_url == '') { error_log("Found no SA in SR!'"); } } if (!isset($ma_url)) { $ma_list = select_services($services, SR_SERVICE_TYPE::MEMBER_AUTHORITY); if (count($ma_list) >= 0) { $ma = $ma_list[0]; $ma_url = $ma[SR_TABLE_FIELDNAME::SERVICE_URL]; } if (!isset($ma_url) || is_null($ma_url) || $ma_url == '') { error_log("Found no MA in SR!'"); } } if (!isset($log_url)) { $log_list = select_services($services, SR_SERVICE_TYPE::LOGGING_SERVICE); if (count($log_list) >= 0) { $log = $log_list[0]; $log_url = $log[SR_TABLE_FIELDNAME::SERVICE_URL]; } if (!isset($log_url) || is_null($log_url) || $log_url == '') { error_log("Found no LOG in SR!'"); } }