• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP time_elapsed函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中time_elapsed函数的典型用法代码示例。如果您正苦于以下问题:PHP time_elapsed函数的具体用法?PHP time_elapsed怎么用?PHP time_elapsed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了time_elapsed函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: start_process

 public function start_process()
 {
     if (!$this->path_to_xml_file) {
         return false;
     }
     if (!$this->valid_xml) {
         return false;
     }
     $this->archive_builder = new \eol_schema\ContentArchiveBuilder(array('directory_path' => DOC_ROOT . 'temp/xml_to_archive/'));
     $this->taxon_ids = array();
     $this->media_ids = array();
     $this->vernacular_name_ids = array();
     $this->reference_ids = array();
     $this->agent_ids = array();
     $reader = new \XMLReader();
     $file = file_get_contents($this->path_to_xml_file);
     $file = iconv("UTF-8", "UTF-8//IGNORE", $file);
     $reader->XML($file);
     $i = 0;
     while (@$reader->read()) {
         if ($reader->nodeType == \XMLReader::ELEMENT && $reader->name == "taxon") {
             $taxon_xml = $reader->readOuterXML();
             $t = simplexml_load_string($taxon_xml, null, LIBXML_NOCDATA);
             if ($t) {
                 $this->add_taxon_to_archive($t);
             }
             $i++;
             if ($i % 100 == 0) {
                 echo "Parsed taxon {$i} : " . time_elapsed() . "\n";
             }
             // if($i >= 5000) break;
         }
     }
     $this->archive_builder->finalize();
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:35,代码来源:XMLToArchive.php


示例2: lookup_block

 private function lookup_block($start, $limit)
 {
     $query = "SELECT tc.id taxon_concept_id, he.id hierarchy_entry_id, he.visibility_id, he.vetted_id, v.view_order vetted_view_order, h.id hierarchy_id, h.browsable, h.label\n            FROM taxon_concepts tc\n            STRAIGHT_JOIN hierarchy_entries he ON (tc.id=he.taxon_concept_id)\n            STRAIGHT_JOIN hierarchies h ON (he.hierarchy_id=h.id)\n            STRAIGHT_JOIN vetted v ON (he.vetted_id=v.id)\n            WHERE tc.id BETWEEN {$start} AND " . ($start + $limit) . " AND he.published=1";
     static $j = 0;
     $all_entries = array();
     foreach ($this->mysqli->iterate_file($query) as $row_num => $row) {
         if ($j % 50000 == 0) {
             echo "{$start} : {$j} : " . time_elapsed() . " : " . memory_get_usage() . "\n";
         }
         $j++;
         $taxon_concept_id = $row[0];
         $hierarchy_entry_id = $row[1];
         $visibility_id = $row[2];
         $vetted_id = $row[3];
         $vetted_view_order = $row[4];
         $hierarchy_id = $row[5];
         $browsable = $row[6];
         $label = $row[7];
         if (!$browsable) {
             $browsable = 0;
         }
         if ($browsable == 'NULL') {
             $browsable = 0;
         }
         if (@(!$all_entries[$taxon_concept_id])) {
             $all_entries[$taxon_concept_id] = array();
         }
         $all_entries[$taxon_concept_id][$hierarchy_id] = array('hierarchy_entry_id' => $hierarchy_entry_id, 'visibility_id' => $visibility_id, 'vetted_id' => $vetted_id, 'vetted_view_order' => $vetted_view_order, 'hierarchy_id' => $hierarchy_id, 'browsable' => $browsable, 'hierarchy_sort_order' => self::hierarchy_sort_order($label));
     }
     $curated_best_entries = $this->lookup_curated_best_entries($start, $limit);
     $this->sort_and_insert_best_entries($all_entries, $curated_best_entries);
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:32,代码来源:PreferredEntriesCalculator.php


示例3: lookup_names

 function lookup_names($start, $limit, &$taxon_concept_ids = array())
 {
     debug("querying names");
     $query = "SELECT n.id, n.string FROM names n WHERE n.id ";
     if ($taxon_concept_ids) {
         $query .= "IN (" . implode(",", $taxon_concept_ids) . ")";
     } else {
         $query .= "BETWEEN {$start} AND " . ($start + $limit);
     }
     static $i = 0;
     foreach ($this->mysqli_slave->iterate_file($query) as $row_num => $row) {
         if ($i % 100000 == 0) {
             echo "   ===> {$i} :: " . time_elapsed() . " :: " . memory_get_usage() . "\n";
         }
         $i++;
         $name_id = $row[0];
         $name_string = $row[1];
         if (preg_match("/[0-9]\\/[0-9]/", $name_string, $arr)) {
             if (Name::is_surrogate($name_string)) {
                 continue;
             }
             $canonical_form = trim($this->name_parser->lookup_string($name_string));
             echo "{$name_id}\t{$name_string}\t{$canonical_form}\n";
         }
     }
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:26,代码来源:NamesCheck.php


示例4: get_eol_photos

 public static function get_eol_photos($per_page, $page, $auth_token = "", $user_id = NULL, $start_date = NULL, $end_date = NULL)
 {
     global $used_image_ids;
     $response = self::pools_get_photos(FLICKR_EOL_GROUP_ID, "", $per_page, $page, $auth_token, $user_id, $start_date, $end_date);
     echo "\n page " . $response->photos->page . " of " . $response->photos->pages . " | total taxa =  " . $response->photos->total . "\n";
     echo "\n -- response count: " . count($response);
     echo "\n -- response photos count per page: " . count($response->photos->photo) . "\n";
     static $count_taxa = 0;
     $page_taxa = array();
     foreach ($response->photos->photo as $photo) {
         if (@$used_image_ids[$photo->id]) {
             continue;
         }
         $count_taxa++;
         echo "taxon {$count_taxa} ({$photo->id}): " . time_elapsed() . "\n";
         $taxa = self::get_taxa_for_photo($photo->id, $photo->secret, $photo->lastupdate, $auth_token, $user_id);
         if ($taxa) {
             foreach ($taxa as $t) {
                 $page_taxa[] = $t;
             }
         }
         $used_image_ids[$photo->id] = true;
     }
     return $page_taxa;
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:25,代码来源:FlickrAPI+orig.php


示例5: profile

function profile($str)
{
    if (!defined('PROFILE') || !PROFILE) {
        return;
    }
    echo time_elapsed() . ":{$str};";
}
开发者ID:nmatasci,项目名称:TNRSbatch,代码行数:7,代码来源:config.php


示例6: get_nodes

 public function get_nodes()
 {
     $path = $this->download_directory . "/nodes.dmp";
     foreach (new FileIterator($path) as $line_number => $line) {
         if ($line_number % 10000 == 0) {
             echo "{$line_number} :: " . time_elapsed() . " :: " . memory_get_usage() . "\n";
         }
         $line_data = explode("\t|", $line);
         $tax_id = trim($line_data[0]);
         $parent_tax_id = trim($line_data[1]);
         $rank = trim($line_data[2]);
         $comments = trim($line_data[12]);
         if (!is_numeric($tax_id)) {
             continue;
         }
         if (!is_numeric($parent_tax_id)) {
             continue;
         }
         if ($rank == "no rank") {
             $rank = "";
         }
         // tax_id 1 is a sudo-node named 'root'. Things with 1 as a parent are the real roots
         if ($parent_tax_id == 1) {
             $parent_tax_id = 0;
         }
         if (isset($this->taxon_names[$tax_id])) {
             $t = new \eol_schema\Taxon();
             $t->taxonID = $tax_id;
             $t->scientificName = $this->taxon_names[$tax_id];
             $t->parentNameUsageID = $parent_tax_id;
             $t->taxonRank = $rank;
             $t->taxonomicStatus = "valid";
             $t->taxonRemarks = $comments;
             $this->archive_builder->write_object_to_file($t);
             if (isset($this->taxon_synonyms[$tax_id])) {
                 foreach ($this->taxon_synonyms[$tax_id] as $name_class => $names) {
                     if (in_array($name_class, array("genbank common name", "common name", "blast name"))) {
                         foreach ($names as $name => $junk) {
                             $v = new \eol_schema\VernacularName();
                             $v->taxonID = $tax_id;
                             $v->vernacularName = $name;
                             $v->language = "en";
                             $this->archive_builder->write_object_to_file($v);
                         }
                     } else {
                         foreach ($names as $name => $junk) {
                             $t = new \eol_schema\Taxon();
                             $t->taxonID = $tax_id . "_syn_" . md5($name . $name_class);
                             $t->scientificName = $name;
                             $t->acceptedNameUsageID = $tax_id;
                             $t->taxonomicStatus = $name_class;
                             $this->archive_builder->write_object_to_file($t);
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:59,代码来源:NCBIConnector.php


示例7: index

 public function index()
 {
     $this->template->setTitle($this->lang->line('text_title'));
     $this->template->setHeading($this->lang->line('text_heading'));
     $this->template->setStyleTag(root_url('assets/js/daterange/daterangepicker-bs3.css'), 'daterangepicker-css', '100400');
     $this->template->setScriptTag(root_url('assets/js/daterange/moment.min.js'), 'daterange-moment-js', '1000451');
     $this->template->setScriptTag(root_url('assets/js/daterange/daterangepicker.js'), 'daterangepicker-js', '1000452');
     $this->template->setScriptTag(root_url('assets/js/Chart.min.js'), 'chart-min-js', '1000453');
     $data['total_menus'] = $this->Dashboard_model->getTotalMenus();
     $data['current_month'] = mdate('%Y-%m', time());
     $data['months'] = array();
     $pastMonth = date('Y-m-d', strtotime(date('Y-m-01') . ' -3 months'));
     $futureMonth = date('Y-m-d', strtotime(date('Y-m-01') . ' +3 months'));
     for ($i = $pastMonth; $i <= $futureMonth; $i = date('Y-m-d', strtotime($i . ' +1 months'))) {
         $data['months'][mdate('%Y-%m', strtotime($i))] = mdate('%F', strtotime($i));
     }
     $data['default_location_id'] = $this->config->item('default_location_id');
     $data['locations'] = array();
     $results = $this->Locations_model->getLocations();
     foreach ($results as $result) {
         $data['locations'][] = array('location_id' => $result['location_id'], 'location_name' => $result['location_name']);
     }
     $filter = array();
     $filter['page'] = '1';
     $filter['limit'] = '10';
     $data['activities'] = array();
     $this->load->model('Activities_model');
     $results = $this->Activities_model->getList($filter);
     foreach ($results as $result) {
         $data['activities'][] = array('activity_id' => $result['activity_id'], 'icon' => 'fa fa-tasks', 'message' => $result['message'], 'time' => mdate('%h:%i %A', strtotime($result['date_added'])), 'time_elapsed' => time_elapsed($result['date_added']), 'state' => $result['status'] === '1' ? 'read' : 'unread');
     }
     $data['top_customers'] = array();
     $results = $this->Dashboard_model->getTopCustomers($filter);
     foreach ($results as $result) {
         $data['top_customers'][] = array('first_name' => $result['first_name'], 'last_name' => $result['last_name'], 'total_orders' => $result['total_orders'], 'total_sale' => $result['total_sale']);
     }
     $filter = array();
     $filter['page'] = '';
     $filter['limit'] = 10;
     $filter['sort_by'] = 'orders.date_added';
     $filter['order_by'] = 'DESC';
     $data['order_by_active'] = 'DESC';
     $data['orders'] = array();
     $this->load->model('Orders_model');
     $results = $this->Orders_model->getList($filter);
     foreach ($results as $result) {
         $current_date = mdate('%d-%m-%Y', time());
         $date_added = mdate('%d-%m-%Y', strtotime($result['date_added']));
         if ($current_date === $date_added) {
             $date_added = $this->lang->line('text_today');
         } else {
             $date_added = mdate('%d %M %y', strtotime($date_added));
         }
         $data['orders'][] = array('order_id' => $result['order_id'], 'location_name' => $result['location_name'], 'first_name' => $result['first_name'], 'last_name' => $result['last_name'], 'order_status' => $result['status_name'], 'status_color' => $result['status_color'], 'order_time' => mdate('%H:%i', strtotime($result['order_time'])), 'order_type' => $result['order_type'] === '1' ? $this->lang->line('text_delivery') : $this->lang->line('text_collection'), 'date_added' => $date_added, 'edit' => site_url('orders/edit?id=' . $result['order_id']));
     }
     $this->template->render('dashboard', $data);
 }
开发者ID:labeetotrent,项目名称:latthiya,代码行数:57,代码来源:Dashboard.php


示例8: get_all_taxa

 public function get_all_taxa()
 {
     if (!file_exists(DOC_ROOT . 'tmp/natureserve')) {
         mkdir(DOC_ROOT . 'tmp/natureserve');
     }
     if (!file_exists(DOC_ROOT . 'tmp/natureserve/images')) {
         mkdir(DOC_ROOT . 'tmp/natureserve/images');
     }
     $this->archive_builder = new \eol_schema\ContentArchiveBuilder(array('directory_path' => DOC_ROOT . "/temp/dwc_archive_test/"));
     $species_list_path = DOC_ROOT . "update_resources/connectors/files/natureserve_species_list.xml";
     shell_exec("rm -f {$species_list_path}");
     shell_exec("curl " . self::SPECIES_LIST_URL . " -o {$species_list_path}");
     $reader = new \XMLReader();
     $reader->open($species_list_path);
     $records = array();
     while (@$reader->read()) {
         if ($reader->nodeType == \XMLReader::ELEMENT && $reader->name == "DATA_RECORD") {
             $record = simplexml_load_string($reader->readOuterXML(), null, LIBXML_NOCDATA);
             $records[] = (string) $record->EGT_UID;
         }
     }
     echo "Total Records: " . count($records) . "\n";
     $chunk_size = 1;
     // shuffle($records);
     // array_unshift($records, 'ELEMENT_GLOBAL.2.104470'); // Bald eagle
     array_unshift($records, 'ELEMENT_GLOBAL.2.102211');
     // Polar bear
     // array_unshift($records, 'ELEMENT_GLOBAL.2.106470'); // bobcat - Lynx rufus
     // array_unshift($records, 'ELEMENT_GLOBAL.2.104731'); // striped bass - Morone saxatilis
     array_unshift($records, 'ELEMENT_GLOBAL.2.105926');
     // American Bullfrog
     array_unshift($records, 'ELEMENT_GLOBAL.2.104777');
     // White tailed deer
     array_unshift($records, 'ELEMENT_GLOBAL.2.100925');
     // golden eagle
     $records = array_unique($records);
     $chunks = array_chunk($records, $chunk_size);
     $i = 0;
     $start_time = time_elapsed();
     foreach ($chunks as $chunk) {
         $this->lookup_multiple_ids($chunk);
         // if($i % 500 == 0) print_r($this->archive_builder->file_columns);
         $i += $chunk_size;
         if ($i % 100 == 0) {
             $estimated_total_time = (time_elapsed() - $start_time) / $i * count($records);
             echo "Time spent ({$i} records) " . time_elapsed() . "\n";
             echo "Estimated total seconds : {$estimated_total_time}\n";
             echo "Estimated total hours : " . $estimated_total_time / (60 * 60) . "\n";
             echo "Memory : " . memory_get_usage() . "\n";
         }
         // if($i >= 100) break;
     }
     $this->archive_builder->finalize();
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:54,代码来源:NatureServeAPI.php


示例9: latest

 public function latest()
 {
     $filter = array();
     $filter['page'] = '1';
     $filter['limit'] = '10';
     $data['activities'] = array();
     $results = $this->Activities_model->getList($filter);
     foreach ($results as $result) {
         $data['activities'][] = array('activity_id' => $result['activity_id'], 'icon' => 'fa fa-tasks', 'message' => $result['message'], 'time' => mdate('%h:%i %A', strtotime($result['date_added'])), 'time_elapsed' => time_elapsed($result['date_added']), 'state' => $result['status'] === '1' ? 'read' : 'unread');
     }
     $this->template->render('activities_latest', $data);
 }
开发者ID:AKCore,项目名称:TastyIgniter,代码行数:12,代码来源:Activities.php


示例10: newsitem

function newsitem($profile_pic, $from, $to, $message, $picture, $name, $link, $caption, $description, $icon, $time, $comments, $likes)
{
    if ($to) {
        $to_section = '<div class="to" >to</div><div class="news-friend-name"><strong><a>' . $to . '</a></strong></div><div class="clear"></div>';
    } else {
        $to_section = '';
    }
    if ($message) {
        $message_section = '<div class="message">' . $message . '</div>';
    } else {
        $message_section = '';
    }
    if ($picture) {
        $picture_section = '<div class="external-image"><img src="' . $picture . '"/></div><div class="news-external">';
    } else {
        $picture_section = '<div class="news-external" style="width: 410px;">';
    }
    if (!$link) {
        $link = '#';
    }
    if ($name) {
        $name_section = '<div class="news-title"><h3><a href="' . $link . '" target="_blank">' . $name . '</a></h3></div>';
    } else {
        $name_section = '';
    }
    if ($caption) {
        $caption_section = '<div class="news-caption"><i>' . $caption . '</i></div>';
    } else {
        $caption_section = '';
    }
    if ($description) {
        $description_section = '<div class="news-desc">' . $description . '</div>';
    } else {
        $description_section = '';
    }
    if ($icon) {
        $icon_section = '<div class="news-icon" ><img src="' . $icon . '" /></div>';
    } else {
        $icon_section = '';
    }
    $time_converted = time_elapsed($time);
    $news = '<div class="news">
						<div class="news-friend-thumb"><img src="' . $profile_pic . '"/></div>
						<div class="news-content">
							<div class="news-friend-name"><strong><a>' . $from . '</a></strong></div>' . $to_section . '<div class="clear"></div>' . $message_section . $picture_section . $name_section . $caption_section . $description_section . '</div>
							<div class="clear"></div>
							<div class="comment-like">' . $icon_section . $time_converted . ' ago  ·  ' . $comments . ' comments  ·  ' . $likes . ' likes</div>
						</div>
					</div>';
    return $news;
}
开发者ID:neelkamal0666,项目名称:FosterGemNews,代码行数:51,代码来源:index.php


示例11: begin_calculating

 public function begin_calculating($taxon_concept_ids = null, $range = null)
 {
     $GLOBALS['top_taxa'] = array();
     $all_scores = array();
     $batches = array(1);
     if ($taxon_concept_ids) {
         $batches = array_chunk($taxon_concept_ids, 10000);
     }
     foreach ($batches as $batch) {
         $query = "SELECT taxon_concept_id, image_trusted, image_unreviewed, text_trusted, text_unreviewed, text_trusted_words, text_unreviewed_words, video_trusted, video_unreviewed, sound_trusted, sound_unreviewed, flash_trusted, flash_unreviewed, youtube_trusted, youtube_unreviewed, iucn_total, data_object_references, info_items, content_partners, has_GBIF_map, BHL_publications, user_submitted_text FROM taxon_concept_metrics";
         if ($taxon_concept_ids) {
             $query .= " WHERE taxon_concept_id IN (" . implode($batch, ",") . ")";
         } elseif ($range) {
             $query .= " WHERE taxon_concept_id BETWEEN {$range}";
         }
         foreach ($this->mysqli_slave->iterate_file($query) as $row_num => $row) {
             static $i = 0;
             if ($i == 0) {
                 echo "QUERY IS DONE (" . time_elapsed() . ")\n";
             }
             $i++;
             if ($i % 10000 == 0) {
                 echo "{$i}: " . memory_get_usage() . "\n";
             }
             $taxon_concept_id = $row[0];
             $this_scores = $this->calculate_score_from_row($row);
             // if($this_scores['total'] >= .5) $all_scores[$taxon_concept_id] = $this_scores;
             $all_scores[$taxon_concept_id] = $this_scores['total'];
         }
     }
     echo "CALCULATIONS ARE DONE (" . time_elapsed() . ") {$range}\n";
     // uasort($all_scores, array('self', 'sort_by_total_score'));
     static $num = 0;
     // $OUT = fopen(DOC_ROOT . '/tmp/richness.txt', 'w+');
     // fwrite($OUT, "RANK\tID\tNAME\tBREADTH\tDEPTH\tDIVERSITY\tTOTAL\n");
     // foreach($all_scores as $id => $scores)
     // {
     //     $num++;
     //     // if($num >= 2500) break;
     //     $str = "$num\t$id\t" . TaxonConcept::get_name($id) ."\t";
     //     $str .= $scores['breadth'] / TaxonConceptMetric::$BREADTH_WEIGHT ."\t";
     //     $str .= $scores['depth'] / TaxonConceptMetric::$DEPTH_WEIGHT ."\t";
     //     $str .= $scores['diversity'] / TaxonConceptMetric::$DIVERSITY_WEIGHT ."\t";
     //     $str .= $scores['total']."\n";
     //     fwrite($OUT, $str);
     // }
     // fclose($OUT);
     return $all_scores;
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:49,代码来源:PageRichnessCalculator.php


示例12: run_stats_gathering_methods

 function run_stats_gathering_methods($methods_to_run, $single_method_to_run = null)
 {
     foreach ($methods_to_run as $method) {
         if ($single_method_to_run && $method != $single_method_to_run) {
             continue;
         }
         $time_start = time_elapsed();
         echo "Calling {$method}\n";
         // create and/or truncate the stats file for this category
         $this->initialize_category_file($method);
         call_user_func(array($this, $method));
         echo "Finished {$method}\n";
         echo "in " . round((time_elapsed() - $time_start) / 60, 2) . " minutes\n\n";
     }
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:15,代码来源:TaxonPageMetricsNew.php


示例13: start

 public static function start($resource_file = null)
 {
     // $document_list_html = Functions::get_remote_file(self::DOCUMENT_LIST);
     $document_list_html = file_get_contents('plazii.html');
     if (preg_match_all("/<a href=\"((http:\\/\\/plazi.cs.umb.edu\\/exist\\/rest\\/db\\/taxonx_docs\\/plazi\\/(.*?))\\?_xsl.*?)\">(.*)<\\/a>/", $document_list_html, $matches, PREG_SET_ORDER)) {
         $count = 0;
         foreach ($matches as $match) {
             $xml_with_stylesheet_url = $match[1];
             $xml_url = $match[2];
             $xml_filename = $match[3];
             echo "{$xml_with_stylesheet_url}\n";
             self::get_metadata($xml_with_stylesheet_url);
             $xml = Functions::lookup_with_cache($xml_url, array('validation_regex' => 'xmlns:'));
             $count += 1;
             echo "\n   >>>>>>>> COUNT: {$count} >> " . time_elapsed() . "\n\n";
             // if($count >= 400) break;
         }
     }
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:19,代码来源:Plazi.php


示例14: read_data

 public function read_data()
 {
     $this->column_labels = array();
     $this->column_indices = array();
     foreach (new FileIterator($this->text_path["obis"]["ranges_OBIS"]) as $line_number => $line) {
         if ($line_number % 1000 == 0) {
             echo "{$line_number} :: " . time_elapsed() . " :: " . memory_get_usage() . "\n";
         }
         $line_data = ContentArchiveReader::line_to_array($line, ",", "\"");
         if ($line_number == 0) {
             $this->column_labels = $line_data;
             foreach ($this->column_labels as $k => $v) {
                 $this->column_indices[$v] = $k;
             }
             continue;
         }
         $this->process_line_data($line_data);
     }
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:19,代码来源:ObisDataConnector.php


示例15: lookup_block2

 private function lookup_block2($start, $limit)
 {
     $query = "SELECT tc.id taxon_concept_id, he.id hierarchy_entry_id, he.identifier, he.source_url, h.label, h.outlink_uri, r.title, h.id FROM taxon_concepts tc JOIN hierarchy_entries he ON (tc.id=he.taxon_concept_id) JOIN hierarchies h ON (he.hierarchy_id=h.id) LEFT JOIN resources r ON (h.id=r.hierarchy_id) WHERE tc.id BETWEEN {$start} AND " . ($start + $limit) . " AND he.published=1 AND he.visibility_id=1";
     static $j = 0;
     $concept_links = array();
     $links_from_hierarchy = array();
     foreach ($this->mysqli->iterate_file($query) as $row_num => $row) {
         if ($j % 50000 == 0) {
             echo "{$start} : {$j} : " . time_elapsed() . " : " . memory_get_usage() . "\n";
         }
         $j++;
         $taxon_concept_id = $row[0];
         $hierarchy_id = $row[7];
         if (@(!$concept_links[$taxon_concept_id])) {
             $concept_links[$taxon_concept_id] = array();
         }
         if (@$links_from_hierarchy[$taxon_concept_id][$hierarchy_id]) {
             continue;
         }
         if ($link = $this->prepare_link($row)) {
             fwrite($this->LINKS_OUT, "{$taxon_concept_id}\t" . $link['title'] . "\t" . $link['url'] . "\n");
             $concept_links[$taxon_concept_id][] = $link;
             $links_from_hierarchy[$taxon_concept_id][$hierarchy_id] = 1;
         }
         // $all_entries[$taxon_concept_id][$hierarchy_id] = array(
         //     'hierarchy_entry_id' => $hierarchy_entry_id,
         //     'visibility_id' => $visibility_id,
         //     'vetted_id' => $vetted_id,
         //     'vetted_view_order' => $vetted_view_order,
         //     'hierarchy_id' => $hierarchy_id,
         //     'browsable' => $browsable);
     }
     // foreach($concept_links as $taxon_concept_id => $links)
     // {
     //     if(!$links) continue;
     //     usort($links, array("php_active_record\GoogleDumpPreparer", "sort_by_title"));
     //     // echo "$taxon_concept_id\n";
     //     // print_r($links);
     //
     // }
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:41,代码来源:GoogleDumpPreparerOriginal.php


示例16: view

 public function view()
 {
     if (!($result = $this->Messages_model->viewMessage($this->uri->rsegment(3), $this->customer->getId()))) {
         // check if customer_id is set in uri string
         $this->alert->set('danger', $this->lang->line('alert_unknown_error'));
         redirect('account/inbox');
     }
     $this->Messages_model->updateState($result['message_id'], $this->customer->getId(), 'read');
     $this->template->setBreadcrumb('<i class="fa fa-home"></i>', '/');
     $this->template->setBreadcrumb($this->lang->line('text_my_account'), 'account/account');
     $this->template->setBreadcrumb($this->lang->line('text_heading'), 'account/inbox');
     $this->template->setBreadcrumb($this->lang->line('text_view_heading'), 'account/inbox/view');
     $this->template->setTitle($this->lang->line('text_view_heading'));
     $this->template->setHeading($this->lang->line('text_view_heading'));
     $data['back_url'] = site_url('account/inbox');
     $data['message_id'] = $result['message_id'];
     $data['date_added'] = time_elapsed($result['date_added']) . ' - ' . mdate('%d %M %y - %H:%i', strtotime($result['date_added']));
     $data['subject'] = $result['subject'];
     $data['body'] = $result['body'];
     $this->template->render('account/inbox_view', $data);
 }
开发者ID:labeetotrent,项目名称:latthiya,代码行数:21,代码来源:Inbox.php


示例17: build_archive

 public function build_archive()
 {
     $this->path_to_archive_directory = CONTENT_RESOURCE_LOCAL_PATH . "/{$this->resource_id}/";
     $this->archive_builder = new \eol_schema\ContentArchiveBuilder(array('directory_path' => $this->path_to_archive_directory));
     $this->column_labels = array();
     $this->column_indices = array();
     $this->taxon_occurrences = array();
     foreach (new FileIterator(self::TAXA_URL) as $line_number => $line) {
         if ($line_number % 1000 == 0) {
             echo "{$line_number} :: " . time_elapsed() . " :: " . memory_get_usage() . "\n";
         }
         $line_data = ContentArchiveReader::line_to_array($line, ",", "\"");
         if ($line_number == 0) {
             $this->column_labels = $line_data;
             foreach ($this->column_labels as $k => $v) {
                 $this->column_indices[$v] = $k;
             }
             continue;
         }
         $taxon = $this->add_taxon($line_data);
         $this->taxon_occurrences[$taxon->taxonID] = $this->add_occurrence($line_data, $taxon);
     }
     $this->column_labels = array();
     $this->column_indices = array();
     foreach (new FileIterator(self::DUMP_URL) as $line_number => $line) {
         if ($line_number % 1000 == 0) {
             echo "{$line_number} :: " . time_elapsed() . " :: " . memory_get_usage() . "\n";
         }
         $line_data = ContentArchiveReader::line_to_array($line, ",", "\"");
         if ($line_number == 0) {
             $this->column_labels = $line_data;
             foreach ($this->column_labels as $k => $v) {
                 $this->column_indices[$v] = $k;
             }
             continue;
         }
         $this->process_line_data($line_data);
     }
     $this->archive_builder->finalize(true);
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:40,代码来源:BioInfoDataConnector.php


示例18: build_archive

 public function build_archive()
 {
     $this->path_to_archive_directory = CONTENT_RESOURCE_LOCAL_PATH . "/{$this->resource_id}/";
     $this->archive_builder = new \eol_schema\ContentArchiveBuilder(array('directory_path' => $this->path_to_archive_directory));
     $this->setup();
     $this->column_labels = array();
     $this->column_indices = array();
     foreach (new FileIterator(self::DUMP_URL) as $line_number => $line) {
         if ($line_number % 1000 == 0) {
             echo "{$line_number} :: " . time_elapsed() . " :: " . memory_get_usage() . "\n";
         }
         $line_data = explode("\t", $line);
         if ($line_number == 0) {
             $this->column_labels = $line_data;
             foreach ($this->column_labels as $k => $v) {
                 $this->column_indices[$v] = $k;
             }
             continue;
         }
         $this->process_line_data($line_data);
         // if($line_number >= 1000) break;
     }
     $this->archive_builder->finalize(true);
 }
开发者ID:eliagbayani,项目名称:maps_test,代码行数:24,代码来源:AnageDataConnector.php


示例19: getList

 private function getList($data, $filter)
 {
     $url = '?';
     if ($this->input->get('page')) {
         $filter['page'] = (int) $this->input->get('page');
     } else {
         $filter['page'] = 1;
     }
     if ($this->config->item('page_limit')) {
         $filter['limit'] = $this->config->item('page_limit');
     } else {
         $filter['limit'] = '';
     }
     if ($this->input->get('filter_search')) {
         $filter['filter_search'] = $data['filter_search'] = $this->input->get('filter_search');
     } else {
         $data['filter_search'] = '';
     }
     if ($this->input->get('filter_access')) {
         $filter['filter_access'] = $data['filter_access'] = $this->input->get('filter_access');
         $url .= 'filter_access=' . $filter['filter_access'] . '&';
     } else {
         $filter['filter_access'] = $data['filter_access'] = '';
     }
     if ($this->input->get('filter_date')) {
         $filter['filter_date'] = $data['filter_date'] = $this->input->get('filter_date');
         $url .= 'filter_date=' . $filter['filter_date'] . '&';
     } else {
         $filter['filter_date'] = $data['filter_date'] = '';
     }
     if ($this->input->get('sort_by')) {
         $filter['sort_by'] = $data['sort_by'] = $this->input->get('sort_by');
     } else {
         $filter['sort_by'] = $data['sort_by'] = 'date_added';
     }
     if ($this->input->get('order_by')) {
         $filter['order_by'] = $data['order_by'] = $this->input->get('order_by');
         $data['order_by_active'] = $this->input->get('order_by') . ' active';
     } else {
         $filter['order_by'] = $data['order_by'] = 'DESC';
         $data['order_by_active'] = '';
     }
     if ($filter['filter_type'] === 'online') {
         $data['text_empty'] = $this->lang->line('text_empty');
     } else {
         $data['text_empty'] = $this->lang->line('text_empty_report');
     }
     $order_by = (isset($filter['order_by']) and $filter['order_by'] == 'ASC') ? 'DESC' : 'ASC';
     $data['sort_date'] = site_url('customers_online' . $url . 'sort_by=date_added&order_by=' . $order_by);
     $customers_online = $this->Customer_online_model->getList($filter);
     $data['customers_online'] = array();
     foreach ($customers_online as $online) {
         $country_code = $online['country_code'] ? strtolower($online['country_code']) : 'no_flag';
         $data['customers_online'][] = array('activity_id' => $online['activity_id'], 'ip_address' => $online['ip_address'], 'customer_name' => $online['customer_id'] ? $online['first_name'] . ' ' . $online['last_name'] : $this->lang->line('text_guest'), 'access_type' => ucwords($online['access_type']), 'browser' => $online['browser'], 'user_agent' => $online['user_agent'], 'request_uri' => !empty($online['request_uri']) ? $online['request_uri'] : '--', 'referrer_uri' => !empty($online['referrer_uri']) ? $online['referrer_uri'] : '--', 'request_url' => !empty($online['request_uri']) ? root_url($online['request_uri']) : '#', 'referrer_url' => !empty($online['referrer_uri']) ? root_url($online['referrer_uri']) : '#', 'date_added' => time_elapsed($online['date_added']), 'country_code' => image_url('data/flags/' . $country_code . '.png'), 'country_name' => $online['country_name'] ? $online['country_name'] : $this->lang->line('text_private'));
     }
     $data['types'] = array('online' => array('badge' => '', 'url' => site_url('customers_online'), 'title' => $this->lang->line('text_online')), 'all' => array('badge' => '', 'url' => site_url('customers_online/all'), 'title' => $this->lang->line('text_all')));
     $data['online_dates'] = array();
     $online_dates = $this->Customer_online_model->getOnlineDates($filter);
     foreach ($online_dates as $date) {
         $month_year = mdate('%Y-%m', strtotime($date['year'] . '-' . $date['month']));
         $data['online_dates'][$month_year] = mdate('%F %Y', strtotime($date['date_added']));
     }
     if ($this->input->get('sort_by') and $this->input->get('order_by')) {
         $url .= 'sort_by=' . $filter['sort_by'] . '&';
         $url .= 'order_by=' . $filter['order_by'] . '&';
     }
     $config['base_url'] = page_url() . $url;
     $config['total_rows'] = $this->Customer_online_model->getCount($filter);
     $config['per_page'] = $filter['limit'];
     $this->pagination->initialize($config);
     $data['pagination'] = array('info' => $this->pagination->create_infos(), 'links' => $this->pagination->create_links());
     return $data;
 }
开发者ID:woakes070048,项目名称:TastyIgniter,代码行数:73,代码来源:Customers_online.php


示例20: form_open

        $menu_name .= '<div class="quick-form" id="qf-' . $row->mid . '">';
        $menu_name .= form_open('sso/menus/act', 'class="form-horizontal"', array('mid' => $row->mid, 'quick' => TRUE));
        $menu_name .= '<div class="form-group">';
        $menu_name .= form_label('Name', 'mnme', array('class' => 'col-xs-4 col-md-2 control-label'));
        $menu_name .= '<div class="col-xs-4 col-md-10">';
        $menu_name .= form_input('mnme', str_replace('_', NULL, $row->mnme), 'class="input-sm form-control" id="mnme" placeholder="Menu name"');
        $menu_name .= '</div>';
        $menu_name .= '</div>';
        $menu_name .= '<div class="form-group">';
        $menu_name .= '<div class="col-sm-offset-2 col-sm-10">';
        $menu_name .= '<button type="submit" class="btn btn-sm btn-primary">Update menu</button>';
        $menu_name .= '<button type="button" class="btn btn-sm btn-default" id="cqe-' . $row->mid . '">Cancel</button>';
        $menu_name .= '</div>';
        $menu_name .= '</div>';
        $menu_name .= form_close();
        $menu_name .= '</div>';
        $menu_icon = '<span class="fa' . $row->mico . '"></span>';
        $menu_link = base_url($row->mlnk);
        $menu_update = mdate('%F %j, %Y on %H:%i',  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP time_elapsed_string函数代码示例发布时间:2022-05-23
下一篇:
PHP time_diff函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap