function _hosting_ip_list in Hostmaster (Aegir) 6
Get an array from the text ip address list.
5 calls to _hosting_ip_list()
- hosting_hosting_server_context_options in modules/
hosting/ server/ hosting_server.drush.inc - hosting_ip_save in modules/
hosting/ server/ hosting.ip.inc - IP Utility function for hook_update/hook_insert.
- hosting_ip_validate in modules/
hosting/ server/ hosting.ip.inc - Validate that IP list is valid. IP utility function for hook_validate.
- hosting_ip_view in modules/
hosting/ server/ hosting.ip.inc - Display the ip address on the node. IP utility function for hook_view.
- hosting_server_form in modules/
hosting/ server/ hosting_server.module - Implementation of hook_form().
File
- modules/
hosting/ server/ hosting.ip.inc, line 10 - General IP address CRUD routines.
Code
function _hosting_ip_list($addresses) {
$return = array();
$ip_list = is_array($addresses) ? $addresses : explode("\n", $addresses);
foreach ($ip_list as $key => $ip) {
$ip = trim($ip);
if (!empty($ip)) {
$return[$key] = $ip;
}
}
return $return;
}