upgrade all with dice compatible
This commit is contained in:
+12
-13
@@ -3,16 +3,15 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Param.php
|
||||
Desc. : Class data parameter dari client side
|
||||
Desc. : Class Parameter Manajemen
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : November 14th, 2013.
|
||||
Last Modified : August 8th, 2026.
|
||||
Last Modified : August 22nd, 2026.
|
||||
|
||||
(c) 2013 - 2026, 3FONIA Software; WWW.3FONIA.COM.
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
//OK
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\webapp\Web;
|
||||
@@ -26,7 +25,7 @@ final class Param {
|
||||
if (count(self::$__ahasil)==0) self::__data();
|
||||
}
|
||||
|
||||
private static function __data() {
|
||||
private static function __data(): void {
|
||||
global $app;
|
||||
if (empty($app)) $app = \Flight::app();
|
||||
$_asumber = array_merge($app->request()->query->getData(), $app->request()->data->getData());
|
||||
@@ -35,28 +34,28 @@ final class Param {
|
||||
}
|
||||
}
|
||||
|
||||
public static function safeSQL($tstr = "") {
|
||||
public static function safeSQL(string $str = ""): string {
|
||||
$_se = array("\\","\0","\n","\r","\x1a","'",'"');
|
||||
$_re = array("\\\\","\\0","\\n","\\r","\Z","\'",'\"');
|
||||
return str_replace($_se, $_re, $tstr);
|
||||
return str_replace($_se, $_re, $str);
|
||||
}
|
||||
|
||||
public static function Get($tkey = "", $tdef = null) {
|
||||
public static function Get(string $key = "", mixed $def = null): mixed {
|
||||
if (count(self::$__ahasil)==0) self::__data();
|
||||
if (isset(self::$__ahasil[$tkey]) && self::$__ahasil[$tkey]) return self::$__ahasil[$tkey];
|
||||
return $tdef;
|
||||
if (isset(self::$__ahasil[$key]) && self::$__ahasil[$key]) return self::$__ahasil[$key];
|
||||
return $def;
|
||||
}
|
||||
|
||||
public static function Get_Text($tkey = "", $tdef = null) {
|
||||
public static function Get_Text(string $key, mixed $def = null): mixed {
|
||||
if (count(self::$__ahasil)==0) self::__data();
|
||||
$_str = (isset(self::$__ahasil[$tkey])) ? self::$__ahasil[$tkey] : $tdef;
|
||||
$_str = (isset(self::$__ahasil[$key])) ? self::$__ahasil[$key] : $def;
|
||||
$_str = str_replace("\\r", "", $_str);
|
||||
$_str = str_replace("\\n", " ", $_str);
|
||||
$_str = str_replace("\\t", " ", $_str);
|
||||
return (trim($_str));
|
||||
}
|
||||
|
||||
public static function Get_Array() {
|
||||
public static function Get_Array(): array {
|
||||
if (count(self::$__ahasil)==0) self::__data();
|
||||
return self::$__ahasil;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user