diff --git a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php index d67c3b1589..0dc4d569f1 100644 --- a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php +++ b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php @@ -127,14 +127,14 @@ final class PhabricatorCalendarEventSearchEngine } $invited_phids = $saved->getParameter('invitedPHIDs'); - $invited_phids = $user_datasource->evaluateTokens($invited_phids); if ($invited_phids) { + $invited_phids = $user_datasource->evaluateTokens($invited_phids); $query->withInvitedPHIDs($invited_phids); } $creator_phids = $saved->getParameter('creatorPHIDs'); - $creator_phids = $user_datasource->evaluateTokens($creator_phids); if ($creator_phids) { + $creator_phids = $user_datasource->evaluateTokens($creator_phids); $query->withCreatorPHIDs($creator_phids); } diff --git a/src/applications/celerity/resources/CelerityResources.php b/src/applications/celerity/resources/CelerityResources.php index b7c5cc2486..9536786a6a 100644 --- a/src/applications/celerity/resources/CelerityResources.php +++ b/src/applications/celerity/resources/CelerityResources.php @@ -5,8 +5,6 @@ */ abstract class CelerityResources extends Phobject { - private $map; - abstract public function getName(); abstract public function getResourceData($name); diff --git a/src/applications/phid/storage/PhabricatorPHID.php b/src/applications/phid/storage/PhabricatorPHID.php index 7acacc9475..f47d3c819f 100644 --- a/src/applications/phid/storage/PhabricatorPHID.php +++ b/src/applications/phid/storage/PhabricatorPHID.php @@ -2,11 +2,6 @@ final class PhabricatorPHID extends Phobject { - protected $phid; - protected $phidType; - protected $ownerPHID; - protected $parentPHID; - public static function generateNewPHID($type, $subtype = null) { if (!$type) { throw new Exception(pht('Can not generate PHID with no type.')); diff --git a/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php b/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php index 65ac146bd0..96125b6aef 100644 --- a/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php +++ b/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php @@ -5,6 +5,7 @@ final class PhabricatorSpacesNamespaceQuery const KEY_ALL = 'spaces.all'; const KEY_DEFAULT = 'spaces.default'; + const KEY_VIEWER = 'spaces.viewer'; private $ids; private $phids; @@ -141,17 +142,25 @@ final class PhabricatorSpacesNamespaceQuery } public static function getViewerSpaces(PhabricatorUser $viewer) { - $spaces = self::getAllSpaces(); + $cache = PhabricatorCaches::getRequestCache(); + $cache_key = self::KEY_VIEWER.'('.$viewer->getPHID().')'; - $result = array(); - foreach ($spaces as $key => $space) { - $can_see = PhabricatorPolicyFilter::hasCapability( - $viewer, - $space, - PhabricatorPolicyCapability::CAN_VIEW); - if ($can_see) { - $result[$key] = $space; + $result = $cache->getKey($cache_key); + if ($result === null) { + $spaces = self::getAllSpaces(); + + $result = array(); + foreach ($spaces as $key => $space) { + $can_see = PhabricatorPolicyFilter::hasCapability( + $viewer, + $space, + PhabricatorPolicyCapability::CAN_VIEW); + if ($can_see) { + $result[$key] = $space; + } } + + $cache->setKey($cache_key, $result); } return $result; diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index fd547c4049..ea541e3cdc 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -1058,7 +1058,7 @@ abstract class PhabricatorApplicationTransactionEditor $mailed = array(); foreach ($messages as $mail) { foreach ($mail->buildRecipientList() as $phid) { - $mailed[$phid] = true; + $mailed[$phid] = $phid; } }