Example #1
0
     case "repou":
         $ord = 'R.description';
         break;
     case "repod":
         $ord = 'R.description desc';
         break;
     case "locu":
         $ord = 'P.location';
         break;
     case "locd":
         $ord = 'P.location desc';
         break;
 }
 $pkg = new package();
 $xml = new xml('searcher', array('version' => '0.1'));
 $xml->startSection('info');
 $xml->startSection('query');
 $xml->setElement('field', $name, array('name' => 'name', 'description' => 'package name'));
 $xml->setElement('field', $desc, array('name' => 'desc', 'descriprion' => 'package description'));
 $xml->setElement('field', $desc, array('name' => 'file', 'descriprion' => 'file name'));
 $xml->endSection();
 $xml->endSection();
 $nres = $pkg->find($name, $desc, $repo, $ord);
 $xml->startSection('results', array('count' => $nres));
 $to = $start + $maxresult;
 if ($to > $nres) {
     $to = $nres;
 }
 if ($start > 0) {
     $from = $start - $maxresult;
     if ($from < 0) {