<commit_before><?php
/*
 * This example shows how database commands can be performed
 * via the PHP BaseX API.
 *
 * The outputstream in this example is the standard output.
 * The result of the query will be written to this output.
 *
 * (C) Workgroup DBIS, University of Konstanz 2005-10, ISC License
 */
include("BaseX.php");

// initialize timer
$start = microtime(true);

// output stream
//$out = fopen("result.tmp", "w");
$out = "php://output";

// command to be performed
//$cmd = "xquery doc('11MB')//item";
$cmd = "xquery 1 to 100";

try {
  // create session
	$session = new Session("localhost", 1984, "admin", "admin");

  // perform command; show info if something went wrong
  if(!$session->execute($cmd)) {
    print $session->info();
  } else {
    print $session->result();
	}

  // print time needed
  print "\n".((microtime(true) - $start) * 1000)." ms";

  // close session
  $session->close();

} catch (Exception $e) {
	print $e->getMessage();
}
?><commit_msg>Bug Fix: Concurrency of index operators<commit_after><?php
/*
 * This example shows how database commands can be performed
 * via the PHP BaseX API.
 *
 * The outputstream in this example is the standard output.
 * The result of the query will be written to this output.
 *
 * (C) Workgroup DBIS, University of Konstanz 2005-10, ISC License
 */
include("BaseX.php");

// initialize timer
$start = microtime(true);

// output stream
//$out = fopen("result.tmp", "w");
$out = "php://output";

// command to be performed
//$cmd = "xquery doc('11MB')//item";
$cmd = "xquery 1 to 10";

try {
  // create session
	$session = new Session("localhost", 1984, "admin", "admin");

  // perform command; show info if something went wrong
  if(!$session->execute($cmd)) {
    print $session->info();
  } else {
    print $session->result();
	}

  // print time needed
  print "\n".((microtime(true) - $start) * 1000)." ms\n";

  // close session
  $session->close();

} catch (Exception $e) {
	print $e->getMessage();
}
?>
{'fraction_non_alphanumeric': 0.167754897036665, 'fraction_numerical': 0.019588146659969864, 'mean_word_length': 3.43652561247216, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7437567', 'n_tokens_mistral': 670, 'n_tokens_neox': 627, 'n_words': 219}