Some rewrites:
- max_proccesses_reach() and maxload_reached() (why no _ behind max?) are called both way, static and with object reference. - this is strongly discouraged and should be avoided as its support (in PHP) may be dropped in future releases. - used $a = get_app(); to encapsulate code (even when the function does currently the same, it may be changed later) Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
@@ -28,7 +28,7 @@ class PConfig {
|
||||
* @return void
|
||||
*/
|
||||
public static function load($uid, $family) {
|
||||
global $a;
|
||||
$a = get_app();
|
||||
$r = q("SELECT `v`,`k` FROM `pconfig` WHERE `cat` = '%s' AND `uid` = %d ORDER BY `cat`, `k`, `id`",
|
||||
dbesc($family),
|
||||
intval($uid)
|
||||
@@ -65,7 +65,7 @@ class PConfig {
|
||||
*/
|
||||
public static function get($uid, $family, $key, $default_value = null, $refresh = false) {
|
||||
|
||||
global $a;
|
||||
$a = get_app();
|
||||
|
||||
if (!$refresh) {
|
||||
// Looking if the whole family isn't set
|
||||
@@ -120,7 +120,7 @@ class PConfig {
|
||||
*/
|
||||
public static function set($uid, $family, $key, $value) {
|
||||
|
||||
global $a;
|
||||
$a = get_app();
|
||||
|
||||
$stored = self::get($uid, $family, $key);
|
||||
|
||||
@@ -171,7 +171,7 @@ class PConfig {
|
||||
*/
|
||||
public static function delete($uid,$family,$key) {
|
||||
|
||||
global $a;
|
||||
$a = get_app();
|
||||
|
||||
if (x($a->config[$uid][$family], $key)) {
|
||||
unset($a->config[$uid][$family][$key]);
|
||||
|
||||
Reference in New Issue
Block a user