You are here

function ARC_api_helper::lock_tables in Taxonomy import/export via XML 6.2

Same name and namespace in other branches
  1. 5.2 arc/ARC_api_helper.php \ARC_api_helper::lock_tables()
  2. 5 arc/ARC_api_helper.php \ARC_api_helper::lock_tables()
  3. 6 arc/ARC_api_helper.php \ARC_api_helper::lock_tables()

File

arc/ARC_api_helper.php, line 254

Class

ARC_api_helper

Code

function lock_tables($custom = "") {
  if ($this->table_lock == "off") {
    $tbls = $this
      ->get_tables();
    $prefix = $this->config["prefix"];
    $code = "";
    foreach ($tbls as $cur_tbl) {
      $code .= strlen($code) ? ", " : "LOCK TABLES ";
      $code .= $prefix . "_" . $cur_tbl . " WRITE";
    }
    if (is_array($custom)) {
      foreach ($custom as $cur_tbl) {
        $code .= strlen($code) ? ", " : "LOCK TABLES ";
        $code .= $cur_tbl . " WRITE";
      }
    }
    $tmp = mysql_query("FLUSH TABLES");
    $tmp = mysql_query($code);
    $this->table_lock = "on";
  }
}