mirror of
https://github.com/ZeroDream-CN/SakuraPanel.git
synced 2025-01-12 09:52:52 +08:00
26 lines
577 B
PHP
Executable File
26 lines
577 B
PHP
Executable File
<?php
|
|
namespace SakuraPanel;
|
|
|
|
use SakuraPanel;
|
|
|
|
class Settings {
|
|
|
|
public static function get($key, $value = "")
|
|
{
|
|
$rs = Database::querySingleLine("settings", Array("key" => $key));
|
|
if($rs) {
|
|
return $rs['value'] ?? $value;
|
|
}
|
|
return $value;
|
|
}
|
|
|
|
public static function set($key, $value = "")
|
|
{
|
|
$rs = Database::querySingleLine("settings", Array("key" => $key));
|
|
if($rs) {
|
|
return Database::update("settings", Array("value" => $value), Array("key" => $key));
|
|
} else {
|
|
return Database::insert("settings", Array("key" => $key, "value" => $value));
|
|
}
|
|
}
|
|
} |