3 final class PhabricatorFaviconRefQuery
extends Phobject
{
7 public function withRefs(array $refs) {
8 assert_instances_of($refs, 'PhabricatorFaviconRef');
13 public function execute() {
14 $viewer = PhabricatorUser
::getOmnipotentUser();
18 $config_digest = PhabricatorFaviconRef
::newConfigurationDigest();
21 foreach ($refs as $ref) {
22 $ref_digest = $ref->newDigest();
23 $ref_key = "favicon({$config_digest},{$ref_digest},8)";
27 ->setCacheKey($ref_key);
29 $ref_map[$ref_key] = $ref;
32 $cache = PhabricatorCaches
::getImmutableCache();
33 $ref_hits = $cache->getKeys(array_keys($ref_map));
35 foreach ($ref_hits as $ref_key => $ref_uri) {
36 $ref_map[$ref_key]->setURI($ref_uri);
37 unset($ref_map[$ref_key]);
42 foreach ($ref_map as $ref_key => $ref) {
43 $ref_uri = $ref->newURI();
44 $ref->setURI($ref_uri);
45 $new_map[$ref_key] = $ref_uri;
48 $cache->setKeys($new_map);