function _query($query) { $pg = $this->_getPagination(); $db = new NuGetDb(); $os = new PhpNugetObjectSearch(); if (strlen($query) > 0) { $os->Parse($query, $db->GetAllColumns()); } else { $os = null; } $count = UrlUtils::GetRequestParamOrDefault("count", "false"); if ($count == "true") { $allRows = $db->GetAllRows(999999, 0, $os); HttpUtils::WriteData(sizeof($allRows)); } $allRows = $db->GetAllRows($pg->Top + 1, $pg->Skip, $os); if (!UrlUtils::IsFake()) { header('Content-Type: application/atom+xml;type=feed;charset=utf-8'); } $baseUrl = UrlUtils::CurrentUrl(Settings::$SiteRoot); // $r = array(); $r["@BASEURL@"] = $baseUrl; $r["@NEXTITEM@"] = ""; echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; echo Utils::ReplaceInFile(Path::Combine($this->_path, "entrytemplatepre.xml"), $r); for ($i = 0; $i < sizeof($allRows) && $i < $pg->Top; $i++) { $row = $allRows[$i]; echo $this->_buildNuspecEntity($baseUrl, $row); } if (sizeof($allRows) >= $pg->Top) { $act = strtolower(UrlUtils::GetRequestParamOrDefault("action", null)); if ($act == "packages") { $act = "Packages"; } if ($act == "search") { $act = "Search"; } if ($act == "findpackagesbyd") { $act = "FindPackagesById"; } if ($act == "getupdates") { $act = "GetUpdates"; } $nq = $this->_setupLastQuery(); if ($act != "Search") { $nq = "\$skip=" . ($pg->Skip + $pg->Top) . "&\$top=" . $pg->Top . $nq; echo "<link rel=\"next\" href=\"" . $baseUrl . "/api/" . $this->_version . "/" . $act . "?" . $nq . "\"/>"; } /*?><link rel="next" href="http://localhost:8020/phpnuget/api/v2/Search?$skip=30&$top=30&searchTerm=''&$filter=IsAbsoluteLatestVersion&$orderby=DownloadCount+desc%2CId"/><?php*/ } echo Utils::ReplaceInFile(Path::Combine($this->_path, "entrytemplatepost.xml"), $r); die; }