]> git.mxchange.org Git - friendica.git/blobdiff - include/Core/PConfig.php
More usage of dbm::is_result($r) instead of count($r):
[friendica.git] / include / Core / PConfig.php
index fc022d62823e3d5af9fbb5294f5a482d70779b02..33ec93c0eb5e4c15c5dfaea24892d70171f1feff 100644 (file)
@@ -28,12 +28,12 @@ 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)
                );
-               if (count($r)) {
+               if (dbm::is_result($r)) {
                        foreach ($r as $rr) {
                                $k = $rr['k'];
                                $a->config[$uid][$family][$k] = $rr['v'];
@@ -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
@@ -118,9 +118,9 @@ class PConfig {
         *  The value to store
         * @return mixed Stored $value or false
         */
-       public static function set($uid,$family,$key,$value) {
+       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]);