2,8 → 2,8 |
|
/* |
* UUID utils for PHP |
* Copyright 2011 - 2022 Daniel Marschall, ViaThinkSoft |
* Version 2022-01-06 |
* Copyright 2011 - 2021 Daniel Marschall, ViaThinkSoft |
* Version 2021-05-21 |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
162,7 → 162,7 |
|
if (function_exists('decode_mac')) { |
echo "\nIn case that this Node ID is a MAC address, here is the interpretation of that MAC address:\n"; |
echo decode_mac($nodeid); |
echo decode_mac($nodeid); /** @phpstan-ignore-line */ |
} |
|
break; |
220,7 → 220,7 |
|
if (function_exists('decode_mac')) { |
echo "\nIn case that this Node ID is a MAC address, here is the interpretation of that MAC address:\n"; |
echo decode_mac($nodeid); |
echo decode_mac($nodeid); /** @phpstan-ignore-line */ |
} |
|
break; |
293,7 → 293,7 |
function oid_to_uuid($oid) { |
if (!is_uuid_oid($oid)) return false; |
|
if (substr($oid,0,1) == '.') { |
if ($oid[0] == '.') { |
$oid = substr($oid, 1); |
} |
$ary = explode('.', $oid); |
313,7 → 313,7 |
} |
|
function is_uuid_oid($oid, $only_allow_root=false) { |
if (substr($oid,0,1) == '.') $oid = substr($oid, 1); // remove leading dot |
if ($oid[0] == '.') $oid = substr($oid, 1); // remove leading dot |
|
$ary = explode('.', $oid); |
|
485,8 → 485,7 |
} |
} else { |
// Linux |
$addresses = @glob('/sys/class/net/'.'*'.'/address'); |
foreach ($addresses as $x) { |
foreach (glob('/sys/class/net/'.'*'.'/address') as $x) { |
if (!strstr($x,'/lo/')) { |
$detected_mac = trim(file_get_contents($x)); |
return $detected_mac; |