return false;
}
- if ($user) {
+ if ($user instanceof User) {
if (Event::handle('StartSetUser', array(&$user))) {
if (!empty($user)) {
if (!$user->hasRight(Right::WEBLOGIN)) {
if ($user === false) {
$user = common_current_user();
}
- if ($user) {
+ if ($user instanceof User) {
return crc32($user->id . ':' . $user->nickname);
} else {
return '0';
*
* @access private
*/
-function common_find_mentions($text, $notice)
+function common_find_mentions($text, Notice $notice)
{
try {
$sender = Profile::getKV('id', $notice->profile_id);
$_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");
}
}
}
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)");
}
}
}