getIfconfig(), $matches, PREG_PATTERN_ORDER)) { $node = $matches[1][0]; $node = str_replace(':', '', $node); $node = str_replace('-', '', $node); } return $node; } /** * Returns the network interface configuration for the system * * @todo Needs evaluation and possibly modification to ensure this works * well across multiple platforms. * @codeCoverageIgnore * @return string */ protected function getIfconfig() { switch (strtoupper(substr(php_uname('a'), 0, 3))) { case 'WIN': $ifconfig = `ipconfig /all 2>&1`; break; case 'DAR': $ifconfig = `ifconfig 2>&1`; break; case 'LIN': default: $ifconfig = `netstat -ie 2>&1`; break; } return $ifconfig; } }