aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php')
-rw-r--r--vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php
index ae6a09eaa..57015133a 100644
--- a/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php
+++ b/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php
@@ -36,7 +36,7 @@ class SystemNodeProvider implements NodeProviderInterface
}
$pattern = '/[^:]([0-9A-Fa-f]{2}([:-])[0-9A-Fa-f]{2}(\2[0-9A-Fa-f]{2}){4})[^:]/';
- $matches = array();
+ $matches = [];
// first try a linux specific way
$node = $this->getSysfs();
@@ -67,7 +67,7 @@ class SystemNodeProvider implements NodeProviderInterface
}
ob_start();
- switch (strtoupper(substr(php_uname('a'), 0, 3))) {
+ switch (strtoupper(substr(constant('PHP_OS'), 0, 3))) {
case 'WIN':
passthru('ipconfig /all 2>&1');
break;
@@ -95,15 +95,18 @@ class SystemNodeProvider implements NodeProviderInterface
{
$mac = false;
- if (strtoupper(php_uname('s')) === 'LINUX') {
+ if (strtoupper(constant('PHP_OS')) === 'LINUX') {
$addressPaths = glob('/sys/class/net/*/address', GLOB_NOSORT);
if (empty($addressPaths)) {
return false;
}
+ $macs = [];
array_walk($addressPaths, function ($addressPath) use (&$macs) {
- $macs[] = file_get_contents($addressPath);
+ if (is_readable($addressPath)) {
+ $macs[] = file_get_contents($addressPath);
+ }
});
$macs = array_map('trim', $macs);