public function run() { $dataStore = new \Spit\DataStores\IssueDataStore(); $issues = $dataStore->getPublicIds(); $links = ""; foreach ($issues as $issue) { $links .= sprintf("<url><loc>http://%s%s</loc></url>", $_SERVER["HTTP_HOST"], $this->app->linkProvider->forIssue($issue->id)); } $format = "<?xml version=\"1.0\" ?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">%s</urlset>"; exit(sprintf($format, $links)); }
private function runIndex() { $dataStore = new \Spit\DataStores\IssueDataStore(); $issues = $dataStore->getForRoadmap($this->app->project->id); $versions = array(); foreach ($issues as $issue) { if (array_key_exists($issue->versionId, $versions)) { $version = $versions[$issue->versionId]; } else { $version = new \Spit\Models\Version(); $version->id = $issue->versionId; $version->name = $issue->version; $version->releaseDate = $issue->versionDate; $version->released = $issue->versionReleased; $version->issues = array(); $versions[$issue->versionId] = $version; } $version->complete += $issue->closed ? 1 : 0; array_push($version->issues, $issue); } $data["versions"] = $versions; $this->showView("changelog", T_("Changelog"), $data); }