]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
??? Not callable?
[quix0rs-gnu-social.git] / lib / util.php
index a32c35395eb91ba004f48d43b828110195d54159..22962325778f3f09ab28575007f637f995d91b01 100644 (file)
@@ -322,7 +322,7 @@ function common_set_user($user)
         return false;
     }
 
-    if ($user) {
+    if ($user instanceof User) {
         if (Event::handle('StartSetUser', array(&$user))) {
             if (!empty($user)) {
                 if (!$user->hasRight(Right::WEBLOGIN)) {
@@ -539,7 +539,7 @@ function common_user_cache_hash($user=false)
     if ($user === false) {
         $user = common_current_user();
     }
-    if ($user) {
+    if ($user instanceof User) {
         return crc32($user->id . ':' . $user->nickname);
     } else {
         return '0';
@@ -667,7 +667,7 @@ function common_linkify_mention($mention)
  *
  * @access private
  */
-function common_find_mentions($text, $notice)
+function common_find_mentions($text, Notice $notice)
 {
     try {
         $sender = Profile::getKV('id', $notice->profile_id);
@@ -2313,7 +2313,7 @@ function common_perf_counter($key, $val=null)
                 $_perfCounters[$key] = array($val);
             }
             if (common_config('site', 'logperf_detail')) {
-                common_log(LOG_DEBUG, "PERF COUNTER HIT: $key $val");
+                common_debug("PERF COUNTER HIT: $key $val");
             }
         }
     }
@@ -2327,14 +2327,14 @@ function common_log_perf_counters()
         if (isset($_startTime)) {
             $endTime = microtime(true);
             $diff = round(($endTime - $_startTime) * 1000);
-            common_log(LOG_DEBUG, "PERF runtime: ${diff}ms");
+            common_debug("PERF runtime: ${diff}ms");
         }
         $counters = $_perfCounters;
         ksort($counters);
         foreach ($counters as $key => $values) {
             $count = count($values);
             $unique = count(array_unique($values));
-            common_log(LOG_DEBUG, "PERF COUNTER: $key $count ($unique unique)");
+            common_debug("PERF COUNTER: $key $count ($unique unique)");
         }
     }
 }