Ejemplo n.º 1
0
 public function __construct()
 {
     $this->mysqli =& $GLOBALS['mysqli_connection'];
     if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
         $this->mysqli_slave = load_mysql_environment('slave');
     } else {
         $this->mysqli_slave =& $this->mysqli;
     }
     $this->sparql_client = SparqlClient::connection();
     $this->published_id = TranslatedResourceStatus::find_or_create_by_label('Published')->id;
     $this->trusted_id = Vetted::trusted()->id;
     $this->unknown_id = Vetted::unknown()->id;
     $this->untrusted_id = Vetted::untrusted()->id;
     $this->visible_id = Visibility::visible()->id;
     $this->invisible_id = Visibility::invisible()->id;
     $this->master_curator_id = CuratorLevel::master_curator()->id;
     $this->full_curator_id = CuratorLevel::full_curator()->id;
     $this->assistant_curator_id = CuratorLevel::assistant_curator()->id;
     $this->curator_ids = CuratorLevel::curator_ids();
     $this->data_object_scope = ChangeableObjectType::data_object_scope();
     $this->worms_content_partner_id = ContentPartner::find_or_create_by_full_name('World Register of Marine Species')->id;
     $this->col_hierarchy_id = Hierarchy::find_or_create_by_label('Species 2000 & ITIS Catalogue of Life: Annual Checklist 2011')->id;
     $this->latest_harvest_event_ids();
     $this->worms_latest_harvest_event_id();
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     $this->mysqli =& $GLOBALS['mysqli_connection'];
     if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
         $this->mysqli_slave = load_mysql_environment('slave');
     } else {
         $this->mysqli_slave =& $this->mysqli;
     }
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     $this->mysqli =& $GLOBALS['db_connection'];
     if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
         $this->mysqli_slave = load_mysql_environment('slave');
     } else {
         $this->mysqli_slave =& $this->mysqli;
     }
     $this->archive_builder = new \eol_schema\ContentArchiveBuilder(array('directory_path' => DOC_ROOT . "/temp/eol_names_archive/"));
     $this->load_all_ranks();
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     $this->mysqli =& $GLOBALS['db_connection'];
     if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
         $this->mysqli_slave = load_mysql_environment('slave');
     } else {
         $this->mysqli_slave =& $this->mysqli;
     }
     require_library('RubyNameParserClient');
     $this->name_parser = new RubyNameParserClient();
 }
Ejemplo n.º 5
0
 public function __construct()
 {
     $this->mysqli =& $GLOBALS['db_connection'];
     if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
         $this->mysqli_slave = load_mysql_environment('slave');
     } else {
         $this->mysqli_slave =& $this->mysqli;
     }
     $this->vetted_sort_orders = array();
     $this->vetted_sort_orders[Vetted::trusted()->id] = 1;
     $this->vetted_sort_orders[Vetted::unknown()->id] = 2;
     $this->vetted_sort_orders[Vetted::untrusted()->id] = 3;
 }
 public function __construct()
 {
     $this->mysqli =& $GLOBALS['db_connection'];
     if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
         $this->mysqli_slave = load_mysql_environment('slave');
     } else {
         $this->mysqli_slave =& $this->mysqli;
     }
     $this->output_directory = DOC_ROOT . "temp/eol_names_and_ranks_to_family_archive/";
     recursive_rmdir($this->output_directory);
     $this->archive_builder = new \eol_schema\ContentArchiveBuilder(array('directory_path' => $this->output_directory));
     $this->load_all_ranks();
     $this->load_all_hierarchies();
 }
 public function __construct($parameters = null)
 {
     $this->mysqli =& $GLOBALS['db_connection'];
     if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
         $this->mysqli_slave = load_mysql_environment('slave');
     } else {
         $this->mysqli_slave =& $this->mysqli;
     }
     // override the default weights
     if ($parameters) {
         foreach ($parameters as $p => $v) {
             if (isset(self::${$p})) {
                 self::${$p} = $v;
             }
         }
     }
 }
Ejemplo n.º 8
0
 public function __construct()
 {
     $this->mysqli =& $GLOBALS['mysqli_connection'];
     if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
         $this->mysqli_slave = load_mysql_environment('slave');
     } else {
         $this->mysqli_slave =& $this->mysqli;
     }
     $this->min_taxon_concept_id = 0;
     $this->max_taxon_concept_id = 0;
     $result = $this->mysqli_slave->query("SELECT MIN(id) min, MAX(id) max FROM taxon_concepts");
     if ($result && ($row = $result->fetch_assoc())) {
         $this->min_taxon_concept_id = $row['min'];
         $this->max_taxon_concept_id = $row['max'];
     }
     print "\n" . date("Y-m-d H:i:s");
     print "\n min: " . $this->min_taxon_concept_id;
     print "\n max: " . $this->max_taxon_concept_id;
     print "\n\n";
     $this->table = "taxon_concept_metrics";
 }
Ejemplo n.º 9
0
 public function __construct()
 {
     $this->mysqli =& $GLOBALS['db_connection'];
     if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
         $this->mysqli_slave = load_mysql_environment('slave');
     } else {
         $this->mysqli_slave =& $this->mysqli;
     }
     $this->output_directory = DOC_ROOT . "temp/eol_archive_objects/";
     recursive_rmdir($this->output_directory);
     $this->archive_builder = new \eol_schema\ContentArchiveBuilder(array('directory_path' => $this->output_directory));
     $this->load_all_ranks();
     $this->load_all_hierarchies();
     $this->load_all_data_types();
     $this->load_all_mime_types();
     $this->load_all_languages();
     $this->load_all_licenses();
     $this->load_all_curated_object_associations();
     $this->load_all_user_object_associations();
     $this->load_all_resources();
     $this->initital_object_associations = array_merge($this->curated_data_objects_taxa, $this->user_data_objects_taxa);
 }
<?php

namespace php_active_record;

define("DOWNLOAD_WAIT_TIME", "1000000");
include_once dirname(__FILE__) . "/../../../config/environment.php";
if ($GLOBALS['ENV_NAME'] == 'production' && environment_defined('slave')) {
    $mysqli = load_mysql_environment('slave');
} else {
    $mysqli =& $GLOBALS['db_connection'];
}
$GLOBALS['objects_updated'] = array();
$GLOBALS['objects_unchanged'] = array();
$GLOBALS['objects_deleted'] = array();
// get the latest harvest even for Wikipedia
$result = $mysqli->query("SELECT MAX(id) max FROM harvest_events he WHERE resource_id=80");
if ($result && ($row = $result->fetch_assoc())) {
    $max_he_id = $row['max'];
    $revision_ids = array();
    // get all DataObjects from that harvest
    $outfile = $mysqli->select_into_outfile("SELECT do.id, do.source_url FROM data_objects_harvest_events dohe JOIN data_objects do ON (dohe.data_object_id=do.id) WHERE dohe.harvest_event_id={$max_he_id}");
    if (!($RESULT = fopen($outfile, "r"))) {
        debug(__CLASS__ . ":" . __LINE__ . ": Couldn't open file: " . $outfile);
        return;
    }
    while (!feof($RESULT)) {
        if ($line = fgets($RESULT, 4096)) {
            $fields = explode("\t", trim($line));
            $data_object_id = $fields[0];
            $source_url = $fields[1];
            if (preg_match("/index\\.php\\?title=(.*?)\\&oldid=([0-9]+)\$/", $source_url, $arr)) {