Esempio n. 1
0
             $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);
             if ($tm->process($name, $search_mode, $cache)) {
                 $tm->generateResponse($cache);
             }
             //$data = array_merge($data, (array)($tm->getData($layout)));
             $data[] = $tm->getData($layout);
         }
     }
     $debug = $tm->debug;
     if ($output == 'xml') {
         $data = $tm->getXML();
     }
     break;
 case 'tnrs_taxamatch':
     require_once 'classes/class.taxamatch.php';
     require_once 'classes/class.tnrs_aggregator.php';
     if ($cache) {
         $output = 'rest';
     }
     $db = select_source($source, $classification);
     $data = array();
     $names = preg_split("/[\r\n;]+/u", $str);
     if (is_array($names)) {
         foreach ($names as $name) {
             $tm = new Taxamatch($db);
             $tm->set('debug_flag', $debug);