Subversion Repositories oidinfo_api

Compare Revisions

Regard whitespace Rev 26 → Rev 27

/trunk/uuid_utils.inc.phps
2,8 → 2,8
 
/*
* UUID utils for PHP
* Copyright 2011 - 2021 Daniel Marschall, ViaThinkSoft
* Version 2021-05-21
* Copyright 2011 - 2022 Daniel Marschall, ViaThinkSoft
* Version 2022-01-06
*
* 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); /** @phpstan-ignore-line */
echo decode_mac($nodeid);
}
 
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); /** @phpstan-ignore-line */
echo decode_mac($nodeid);
}
 
break;
293,7 → 293,7
function oid_to_uuid($oid) {
if (!is_uuid_oid($oid)) return false;
 
if ($oid[0] == '.') {
if (substr($oid,0,1) == '.') {
$oid = substr($oid, 1);
}
$ary = explode('.', $oid);
313,7 → 313,7
}
 
function is_uuid_oid($oid, $only_allow_root=false) {
if ($oid[0] == '.') $oid = substr($oid, 1); // remove leading dot
if (substr($oid,0,1) == '.') $oid = substr($oid, 1); // remove leading dot
 
$ary = explode('.', $oid);
 
485,7 → 485,8
}
} else {
// Linux
foreach (glob('/sys/class/net/'.'*'.'/address') as $x) {
$addresses = @glob('/sys/class/net/'.'*'.'/address');
foreach ($addresses as $x) {
if (!strstr($x,'/lo/')) {
$detected_mac = trim(file_get_contents($x));
return $detected_mac;