Use uuidgen on FreeBSD
This commit is contained in:
@@ -149,12 +149,11 @@
|
|||||||
function uuid() {
|
function uuid() {
|
||||||
$uuid = null;
|
$uuid = null;
|
||||||
if (PHP_OS === 'FreeBSD') {
|
if (PHP_OS === 'FreeBSD') {
|
||||||
$uuid = trim(shell_exec("uuid -v 4"));
|
$uuid = trim(shell_exec("uuidgen"));
|
||||||
if (is_uuid($uuid)) {
|
if (is_uuid($uuid)) {
|
||||||
return $uuid;
|
return $uuid;
|
||||||
} else {
|
} else {
|
||||||
echo "Please install the following package.\n";
|
echo "Please install uuidgen.\n";
|
||||||
echo "pkg install ossp-uuid\n";
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,7 +166,7 @@
|
|||||||
if (is_uuid($uuid)) {
|
if (is_uuid($uuid)) {
|
||||||
return $uuid;
|
return $uuid;
|
||||||
} else {
|
} else {
|
||||||
echo "Please install the uuidgen.\n";
|
echo "Please install uuidgen.\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user