You are here

function ARC_api::drop_merge_tables in Taxonomy import/export via XML 5

Same name and namespace in other branches
  1. 5.2 arc/ARC_api.php \ARC_api::drop_merge_tables()
  2. 6.2 arc/ARC_api.php \ARC_api::drop_merge_tables()
  3. 6 arc/ARC_api.php \ARC_api::drop_merge_tables()
1 call to ARC_api::drop_merge_tables()
ARC_api::custom_destruct in arc/ARC_api.php

File

arc/ARC_api.php, line 298

Class

ARC_api

Code

function drop_merge_tables() {
  if (!in_array($this->config["store_type"], array(
    "split",
    "basic+",
  ))) {
    return true;
  }
  if ($creator =& $this
    ->get_merge_table_creator()) {
    if ($store =& $this
      ->get_store()) {
      $my_m = "" . $this
        ->get_init_mtime();
      $stored_m = "" . $store
        ->get_store_var("merge_info", "global", "merge_tbl_mtime");
      $m_diff = $my_m - $stored_m;
      if ($my_m >= $stored_m || $m_diff > 36000) {

        /* no other users or old tables (10 hours) */
        return $creator
          ->drop_merge_tables();
      }
    }
  }
  return $this
    ->get_default_error();
}