Compare commits
3
Commits
2be02c36ec
...
v1.0.10
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf100a86e2 | ||
|
|
a538cc0cc5 | ||
|
|
4c8399cf64 |
+5
-5
@@ -18,12 +18,12 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=8.3",
|
||||
"flightphp/core": "^3.18",
|
||||
"flightphp/core": "^3.19",
|
||||
"flightphp/session": "^0.3",
|
||||
"mpdf/mpdf": ">=8.0",
|
||||
"avadim/fast-excel-writer": "^6.17",
|
||||
"matthiasmullie/minify": ">=1.3",
|
||||
"endroid/qr-code": ">=4.4"
|
||||
"mpdf/mpdf": "^8.3",
|
||||
"avadim/fast-excel-writer": "^6.19",
|
||||
"matthiasmullie/minify": "^1.3",
|
||||
"endroid/qr-code": "^6.1"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": ["src/"],
|
||||
|
||||
+39
-1
@@ -6,7 +6,7 @@
|
||||
Desc. : Fungsi Custom Lain Lain
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 27th, 2008.
|
||||
Last Modified : August 21st, 2026.
|
||||
Last Modified : October 27th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
@@ -362,3 +362,41 @@ if (!function_exists('random_color')) {
|
||||
return "rgba(".$col_r.",".$col_g.",".$col_b.",".$trans.")";
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('gen_uuidv4')) {
|
||||
function gen_uuidv4(): string {
|
||||
$data = random_bytes(16);
|
||||
// Set version to 0100 (UUID v4)
|
||||
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
|
||||
// Set bits 6-7 to 10
|
||||
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
|
||||
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('gen_uuidv7')) {
|
||||
function gen_uuidv7(int $time=0): string {
|
||||
// Get timestamp in milliseconds (48 bits)
|
||||
if (empty($time)) $time = (int) floor(microtime(true) * 1000);
|
||||
// Generate 16 bytes of random data
|
||||
$randomBytes = random_bytes(16);
|
||||
// Pack the 48-bit timestamp into the first 6 bytes
|
||||
$timeHex = str_pad(dechex($time), 12, '0', STR_PAD_LEFT);
|
||||
$bytes = hex2bin($timeHex);
|
||||
// Append 10 bytes of randomness (we need 16 total bytes)
|
||||
$bytes .= substr($randomBytes, 0, 10);
|
||||
// Apply the version bits (Version 7 -> 0b0111) onto byte 6
|
||||
$bytes[6] = chr((ord($bytes[6]) & 0x0f) | 0x70);
|
||||
// Apply the variant bits (Variant 1 -> 0b10xx) onto byte 8
|
||||
$bytes[8] = chr((ord($bytes[8]) & 0x3f) | 0x80);
|
||||
// Unpack to hex string and format with hyphens
|
||||
$hex = bin2hex($bytes);
|
||||
return sprintf('%08s-%04s-%04s-%04s-%012s',
|
||||
substr($hex, 0, 8),
|
||||
substr($hex, 8, 4),
|
||||
substr($hex, 12, 4),
|
||||
substr($hex, 16, 4),
|
||||
substr($hex, 20, 12)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
Module : /Web/Menu.php
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 16th, 2008.
|
||||
Last Modified : October 21st, 2026.
|
||||
Last Modified : October 30th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
@@ -141,7 +141,7 @@ final class Menu {
|
||||
$href1 = '//127.0.0.1/';
|
||||
$href2 = "";
|
||||
} else {
|
||||
$_host = $this->app->request()->getVar('HTTP_ORIGIN') ?? $this->app->request()->getVar('HTTP_HOST') ?? $this->web_app['PARENT_SITE'];
|
||||
$_host = $_SERVER['HTTP_ORIGIN'] ?? $_SERVER['HTTP_HOST'] ?? $this->web_app['PARENT_SITE'];
|
||||
$_host = str_replace(['http://','https://'], "", $_host);
|
||||
if ($this->web_app['PARENT_SUB'] === true) {
|
||||
$_subs = explode('.', $_host);
|
||||
|
||||
Reference in New Issue
Block a user