예제 #1
0
    if (!isset($field[0]) || $field[0] == '') {
        continue;
    }
    $ta = new TnrsAggregator($db);
    $tm = new Taxamatch($db);
    $tm->set('debug_flag', '');
    $tm->set('output_type', '');
    $tm->set('cache_flag', false);
    $tm->set('cache_path', CACHE_PATH);
    $tm->set('name_parser', NAME_PARSER);
    $tm->set('chop_overload', CHOP_OVERLOAD);
    $tm->set('parse_only', $parse_only);
    $name = escapeshellarg($field[0]);
    if ($tm->process($name, $search_mode, $cache) && !$parse_only) {
        $tm->generateResponse($cache);
    }
    $ta->aggregate($tm);
    $result = $ta->getData();
    foreach ($result as $re) {
        if (isset($count)) {
            array_unshift($re, $count);
        }
        fputcsv($outfh, $re);
    }
    unset($result);
    $count++;
}
fclose($outfh);
?>

예제 #2
0
     if (is_array($names)) {
         foreach ($names as $name) {
             $tm = new Taxamatch($db);
             $tm->set('debug_flag', $debug);
             $tm->set('output_type', strtolower($output));
             $tm->set('cache_flag', $authorities[$source]['cache_flag']);
             $tm->set('cache_path', CACHE_PATH);
             $tm->set('name_parser', NAME_PARSER);
             $tm->set('chop_overload', CHOP_OVERLOAD);
             $tm->set('parse_only', $parse_only);
             if ($tm->process($name, $search_mode, $cache)) {
                 $tm->generateResponse($cache);
             }
             $ta = new TnrsAggregator($db);
             $ta->aggregate($tm);
             $data[] = $ta->getData();
         }
     }
     //$debug = $tm->debug;
     //if($output == 'xml') {
     //	$data = $tm->getXML();
     //}
     break;
 case 'sources':
     $db = select_source($source, $classification);
     $data = $db->getSources();
     break;
     //case 'sources':
     //	$sources = getSources();
     //	$data = $sources;
     //	break;