Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/storage/PhabricatorUser.php
Show First 20 Lines • Show All 1,067 Lines • ▼ Show 20 Lines | if (!$user) { | ||||
$user = new PhabricatorUser(); | $user = new PhabricatorUser(); | ||||
$user->omnipotent = true; | $user->omnipotent = true; | ||||
$user->makeEphemeral(); | $user->makeEphemeral(); | ||||
} | } | ||||
return $user; | return $user; | ||||
} | } | ||||
/** | |||||
* Get a scalar string identifying this user. | |||||
* | |||||
* This is similar to using the PHID, but distinguishes between ominpotent | |||||
* and public users explicitly. This allows safe construction of cache keys | |||||
* or cache buckets which do not conflate public and omnipotent users. | |||||
* | |||||
* @return string Scalar identifier. | |||||
*/ | |||||
public function getCacheFragment() { | |||||
if ($this->isOmnipotent()) { | |||||
return 'u.omnipotent'; | |||||
} | |||||
$phid = $this->getPHID(); | |||||
if ($phid) { | |||||
return 'u.'.$phid; | |||||
} | |||||
return 'u.public'; | |||||
} | |||||
/* -( Managing Handles )--------------------------------------------------- */ | /* -( Managing Handles )--------------------------------------------------- */ | ||||
/** | /** | ||||
* Get a @{class:PhabricatorHandleList} which benefits from this viewer's | * Get a @{class:PhabricatorHandleList} which benefits from this viewer's | ||||
* internal handle pool. | * internal handle pool. | ||||
* | * | ||||
* @param list<phid> List of PHIDs to load. | * @param list<phid> List of PHIDs to load. | ||||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |