<commit_before><?php

use Friendica\Database\DBA;

function dbesc($str) {
	if (DBA::$connected) {
		return(DBA::escape($str));
	} else {
		return(str_replace("'","\\'",$str));
	}
}

/**
 * @brief execute SQL query with printf style args - deprecated
 *
 * Please use the dba:: functions instead:
 * dba::select, dba::exists, dba::insert
 * dba::delete, dba::update, dba::p, dba::e
 *
 * @param $args Query parameters (1 to N parameters of different types)
 * @return array|bool Query array
 */
function q($sql) {
	$args = func_get_args();
	unset($args[0]);

	if (!DBA::$connected) {
		return false;
	}

	$sql = DBA::cleanQuery($sql);
	$sql = DBA::anyValueFallback($sql);

	$stmt = @vsprintf($sql, $args);

	$ret = DBA::p($stmt);

	if (is_bool($ret)) {
		return $ret;
	}

	$columns = DBA::columnCount($ret);

	$data = DBA::toArray($ret);

	if ((count($data) == 0) && ($columns == 0)) {
		return true;
	}

	return $data;
}

function dba_timer() {
	return microtime(true);
}
<commit_msg>Remove dbesc() and dba_timer() function declarations<commit_after><?php

use Friendica\Database\DBA;

/**
 * @brief execute SQL query with printf style args - deprecated
 *
 * Please use the dba:: functions instead:
 * dba::select, dba::exists, dba::insert
 * dba::delete, dba::update, dba::p, dba::e
 *
 * @param $args Query parameters (1 to N parameters of different types)
 * @return array|bool Query array
 */
function q($sql) {
	$args = func_get_args();
	unset($args[0]);

	if (!DBA::$connected) {
		return false;
	}

	$sql = DBA::cleanQuery($sql);
	$sql = DBA::anyValueFallback($sql);

	$stmt = @vsprintf($sql, $args);

	$ret = DBA::p($stmt);

	if (is_bool($ret)) {
		return $ret;
	}

	$columns = DBA::columnCount($ret);

	$data = DBA::toArray($ret);

	if ((count($data) == 0) && ($columns == 0)) {
		return true;
	}

	return $data;
}

{'fraction_non_alphanumeric': 0.1967123287671233, 'fraction_numerical': 0.004383561643835616, 'mean_word_length': 4.4183976261127595, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6017855', 'n_tokens_mistral': 711, 'n_tokens_neox': 687, 'n_words': 166}