diff --git a/src/extensions/PhabricatorSitemapsController.php b/src/extensions/PhabricatorSitemapsController.php index 9bc163f69..31818f669 100644 --- a/src/extensions/PhabricatorSitemapsController.php +++ b/src/extensions/PhabricatorSitemapsController.php @@ -1,126 +1,126 @@ getViewer(); $out = array(); // headers $out[] = ''; $out[] = ''; // Static pages $today = date("Y-m-d"); $out[] = $this->url('/', $today, 'daily', '1.0'); $out[] = $this->url('/diffusion/', $today, 'daily', '0.9'); $out[] = $this->url('/phriction/', $today, 'daily', '0.9'); $out[] = $this->url('/project/', $today, 'daily', '0.9'); $out[] = $this->url('/audit/', $today, 'weekly', '0.5'); $out[] = $this->url('/differential/', $today, 'weekly', '0.5'); $out[] = $this->url('/maniphest/', $today, 'weekly', '0.5'); $out[] = $this->url('/paste/', $today, 'weekly', '0.5'); $out[] = $this->url('/feed/', $today, 'weekly', '0.4'); $out[] = $this->url('/file/', $today, 'weekly', '0.4'); $out[] = $this->url('/calendar/', $today, 'monthly', '0.1'); $out[] = $this->url('/conpherence/', $today, 'monthly', '0.1'); //$out[] = $this->url('/dashboard/', $today, 'monthly', '0.1'); $out[] = $this->url('/people/', $today, 'monthly', '0.1'); $out[] = $this->url('/phurl/', $today, 'monthly', '0.1'); $out[] = $this->url('/badges/', $today, 'monthly', '0.1'); $out[] = $this->url('/countdown/', $today, 'monthly', '0.1'); $out[] = $this->url('/diviner/', $today, 'monthly', '0.1'); $out[] = $this->url('/flag/', $today, 'monthly', '0.1'); $out[] = $this->url('/harbormaster/', $today, 'monthly', '0.1'); //$out[] = $this->url('/herald/', $today, 'monthly', '0.1'); $out[] = $this->url('/legalpad/', $today, 'monthly', '0.1'); $out[] = $this->url('/macro/', $today, 'monthly', '0.1'); //$out[] = $this->url('/passphrase/', $today, 'monthly', '0.1'); $out[] = $this->url('/applications/', $today, 'yearly', '0.0'); $out[] = $this->url('/auth/', $today, 'never', '0.0'); $out[] = $this->url('/config/', $today, 'never', '0.0'); $out[] = $this->url('/daemon/', $today, 'never', '0.0'); $out[] = $this->url('/mail/', $today, 'never', '0.0'); //$out[] = $this->url('/conduit/', $today, 'never', '0.0'); // Repositories $repo = id(new PhabricatorRepositoryQuery()) ->setViewer($user) - ->withStatuses(array(PhrictionDocumentStatus::STATUS_EXISTS)) + ->withStatus(PhabricatorRepositoryQuery::STATUS_OPEN) ->execute(); foreach($repo as $r) { $out[] = $this->url( $r->getURI(), date('c', $r->getDateModified()), 'weekly', '0.8' ); } // Projects $project = id(new PhabricatorProjectQuery()) ->setViewer($user) ->execute(); foreach($project as $p) { $out[] = $this->url( $p->getURI(), date('c', $p->getDateModified()), 'weekly', '0.8' ); } // Wiki $wiki = id(new PhrictionDocumentQuery()) ->setViewer($user) ->needContent(true) ->withStatuses(array(PhrictionDocumentStatus::STATUS_EXISTS)) ->execute(); foreach($wiki as $w) { $out[] = $this->url( $w->getSlugURI($w->getSlug()), date('c', $w->getContent()->getDateModified()), 'weekly', '0.8' ); } // Files $files = id(new PhabricatorFileQuery()) ->setViewer($user) ->showOnlyExplicitUploads(true) ->execute(); foreach($files as $f){ if($f->getTTL()) continue; // Ignore temporary files $out[] = $this->url( '/file/info/' . $f->getPHID(), date('c', $f->getDateCreated()), 'weekly', '0.4' ); } // Footer $out[] = ''; $content = implode("\n", $out)."\n"; return id(new AphrontFileResponse()) ->setContent($content) ->setMimeType('text/xml') ->setCacheDurationInSeconds(phutil_units('10 minutes in seconds')) ->setCanCDN(true); } private function url($loc, $mod, $freq, $priority) { $uri = PhabricatorEnv::getURI($loc); return "" . " ${uri}" . " ${mod}" . " ${freq}" . " ${priority}" . ""; } }