<commit_before><?php
require_once dirname(dirname(__DIR__)) . "/classes/autoload.php";
require_once dirname(dirname(__DIR__)) . "/lib./xsrf.php";
require_once ("/etc/apache2/capstone-mysql/encrypted-config.php");
require_once (dirname(dirname(dirname(dirname(__DIR__)))) . "/vendor/autoload");

/**
 * API for the game class
 * @author <NAME> < <EMAIL>
 */

//verify the xsrf challange
if(session_status() !== PHP_SESSION_ACTIVE){
	session_start();
}

// prepare an empty reply
$reply = new stdClass();
$reply->status = 200;
$reply->data = null;

	// grab the mySQL connection
	$pdo = connectToEncryptedMySQL("/etc/apache2/capstone-mysql/sprots.ini");

//determine which HTTP method was used
$method = array_key_exists("HTTP_X_HTTP_METHOD", $_SERVER) ? $_SERVER["HTTP_X_HTTP_METHOD"] : $SERVER["REQUEST_METHOD"];

//sanitize inputs
$id = filter_input(INPUT_GET, "id", FILTER_VALIDATE_INT);
//make sure the id is valid for methods that require it
if(($method === "DELETE" || $method === "PUT") && (empty($id) === true || $id < 0)){
	throw(new InvalidArgumentException("id can not be empty or negitive", 405 ));
}

//sanitize and trim other fields
$<commit_msg>waiting on filter validate date https://app.asana.com/0/84113659891121/94393680990009<commit_after><?php
require_once dirname(dirname(__DIR__)) . "/classes/autoload.php";
require_once dirname(dirname(__DIR__)) . "/lib./xsrf.php";
require_once ("/etc/apache2/capstone-mysql/encrypted-config.php");
require_once (dirname(dirname(dirname(dirname(__DIR__)))) . "/vendor/autoload");

/**
 * API for the game class
 * @author <NAME> < <EMAIL>
 */

//verify the xsrf challange
if(session_status() !== PHP_SESSION_ACTIVE){
	session_start();
}

// prepare an empty reply
$reply = new stdClass();
$reply->status = 200;
$reply->data = null;

	// grab the mySQL connection
	$pdo = connectToEncryptedMySQL("/etc/apache2/capstone-mysql/sprots.ini");

//determine which HTTP method was used
$method = array_key_exists("HTTP_X_HTTP_METHOD", $_SERVER) ? $_SERVER["HTTP_X_HTTP_METHOD"] : $SERVER["REQUEST_METHOD"];

//sanitize inputs
$id = filter_input(INPUT_GET, "id", FILTER_VALIDATE_INT);
//make sure the id is valid for methods that require it
if(($method === "DELETE" || $method === "PUT") && (empty($id) === true || $id < 0)){
	throw(new InvalidArgumentException("id can not be empty or negitive", 405 ));
}

//sanitize and trim other fields
$gameId = filter_input(INPUT_GET, "gameId", FILTER_VALIDATE_INT);
$gameFirstTeamId = filter_input(INPUT_GET, "gameFirstTeamId", FILTER_VALIDATE_INT);
$gameSecondTeamId = filter_input(INPUT_GET, "gameSecondTeamID", FILTER_VALIDATE_INT);
$gameTime = filter_input(INPUT_GET, "gameTime", FILTER_VALIDATE_DATE);
{'fraction_non_alphanumeric': 0.1614100185528757, 'fraction_numerical': 0.017439703153988868, 'mean_word_length': 5.877551020408164, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 1, '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': '1061242', 'n_tokens_mistral': 934, 'n_tokens_neox': 902, 'n_words': 209}