function generate_EnvEOL_data()
 {
     require_library('connectors/IUCNRedlistDataConnector');
     $func = new IUCNRedlistDataConnector();
     $basenames = array("eol_env_annotations_noParentTerms");
     // list of needed basenames
     $options = $this->download_options;
     $options['expire_seconds'] = 2592000 * 3;
     // 3 months before cache expires
     $text_path = $func->load_zip_contents($this->species_list_export, $options, $basenames, ".tsv");
     print_r($text_path);
     self::csv_to_array($text_path[$basenames[0]]);
     $this->archive_builder->finalize(TRUE);
     // remove temp dir
     $parts = pathinfo($text_path[$basenames[0]]);
     recursive_rmdir($parts["dirname"]);
     debug("\n temporary directory removed: " . $parts["dirname"]);
     recursive_rmdir($this->TEMP_DIR);
     // comment this if u want to check "need_to_check_tc_id.txt"
     /* run problematic tc_ids with cache=0 --- a utility
        $tc_ids = self::get_dump();
        foreach($tc_ids as $tc_id)
        {
            $rec['taxon_id'] = $tc_id;
            self::prepare_taxon($rec);
        }
        exit("\n-exit-\n");
        */
 }
예제 #2
0
 private function access_raw_data()
 {
     require_library('connectors/IUCNRedlistDataConnector');
     $func = new IUCNRedlistDataConnector();
     $basenames = array("tnames_OBIS", "ranges_OBIS");
     // csv files: taxa file, data file respectively
     $this->text_path["obis"] = $func->load_zip_contents($this->obis_csv_zip_file, $this->download_options, $basenames, ".csv");
     $this->text_path["worms"] = $func->load_zip_contents($this->worms_taxon_tab_zip_file, $this->download_options, array("worms_taxon"), ".tab");
     print_r($this->text_path);
     $this->worms_taxa = self::get_worms_taxa();
 }