mirror of
https://github.com/friendica/friendica
synced 2025-04-27 12:30:11 +00:00
Some performance tweeks
This commit is contained in:
parent
977e4fe5d9
commit
45c12e7716
5 changed files with 12 additions and 7 deletions
|
@ -97,6 +97,8 @@ class User
|
|||
* @}
|
||||
*/
|
||||
|
||||
private static $owner;
|
||||
|
||||
/**
|
||||
* Returns true if a user record exists with the provided id
|
||||
*
|
||||
|
@ -213,6 +215,10 @@ class User
|
|||
*/
|
||||
public static function getOwnerDataById($uid, $check_valid = true)
|
||||
{
|
||||
if (!empty(self::$owner)) {
|
||||
return self::$owner;
|
||||
}
|
||||
|
||||
$owner = DBA::selectFirst('owner-view', [], ['uid' => $uid]);
|
||||
if (!DBA::isResult($owner)) {
|
||||
if (!DBA::exists('user', ['uid' => $uid]) || !$check_valid) {
|
||||
|
@ -256,6 +262,7 @@ class User
|
|||
$owner = self::getOwnerDataById($uid, false);
|
||||
}
|
||||
|
||||
self::$owner = $owner;
|
||||
return $owner;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue