mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-14 15:56:48 +03:00
Merge pull request #45 from yberkholz/master
"passthru" replacement for "backtick operator" / getNodeFromSystem once per runtime
This commit is contained in:
+11
-5
@@ -1134,20 +1134,21 @@ final class Uuid
|
||||
*/
|
||||
protected static function getIfconfig()
|
||||
{
|
||||
ob_start();
|
||||
switch (strtoupper(substr(php_uname('a'), 0, 3))) {
|
||||
case 'WIN':
|
||||
$ifconfig = `ipconfig /all 2>&1`;
|
||||
passthru('ipconfig /all 2>&1');
|
||||
break;
|
||||
case 'DAR':
|
||||
$ifconfig = `ifconfig 2>&1`;
|
||||
passthru('ifconfig 2>&1');
|
||||
break;
|
||||
case 'LIN':
|
||||
default:
|
||||
$ifconfig = `netstat -ie 2>&1`;
|
||||
passthru('netstat -ie 2>&1');
|
||||
break;
|
||||
}
|
||||
|
||||
return $ifconfig;
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1162,7 +1163,12 @@ final class Uuid
|
||||
*/
|
||||
protected static function getNodeFromSystem()
|
||||
{
|
||||
$node = null;
|
||||
static $node = null;
|
||||
|
||||
if($node !== null) {
|
||||
return $node;
|
||||
}
|
||||
|
||||
$pattern = '/[^:]([0-9A-Fa-f]{2}([:-])[0-9A-Fa-f]{2}(\2[0-9A-Fa-f]{2}){4})[^:]/';
|
||||
$matches = array();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user