<commit_before><?php
	function insert($xml)
	{
		//Standard SQL connection stuff
		$linkID = mysql_connect("localhost", "root", "") or die ("Could not connect to database!");
		mysql_select_db("agora", $linkID) or die ("Could not find database");
		
		//Dig the Map ID out of the XML
		
		//Check to see if the map already exists
		//$mapClause = mysql_real_escape_string("$mapID");
		
		//If not, create it!
		
		//Validate nodes
		//Validate textboxes
		//Validate nodetext
		//Validate arguments
		//Validate connections
		
		
		//Insert/update everything
		
		//Set up the basics of the output XML.
		header("Content-type: text/xml");
		$xmlstr = "<?xml version='1.0' ?>\n<map></map>";
		$output = new SimpleXMLElement($xmlstr);
		return $output;
	}
	$xml = $_REQUEST['xml']; //TODO: Change this back to a GET when all testing is done.
	$output = insert($xml); 
	print($output->asXML());
?><commit_msg>Progress made: remembering to make it a SimpleXMLElement()<commit_after><?php
	function insert($xmlin)
	{
		//Standard SQL connection stuff
		$linkID = mysql_connect("localhost", "root", "") or die ("Could not connect to database!");
		mysql_select_db("agora", $linkID) or die ("Could not find database");
		
		//Dig the Map ID out of the XML
		$xml = new SimpleXMLElement($xmlin);
		print($xml['id']);
		
		//Check to see if the map already exists
		//$mapClause = mysql_real_escape_string("$mapID");
		
		//If not, create it!
		
		//Validate nodes
		//Validate textboxes
		//Validate nodetext
		//Validate arguments
		//Validate connections
		
		//If ANY of the above failed, we bail out.
		
		//Loop across every thing,
			//decide whether to INSERT or UPDATE.
			//do that
	
		
		//Set up the basics of the output XML.
		/*
		header("Content-type: text/xml");
		$xmlstr = "<?xml version='1.0' ?>\n<map></map>";
		$output = new SimpleXMLElement($xmlstr);
		return $output;
		*/
	}
	$xml = $_REQUEST['xml']; //TODO: Change this back to a GET when all testing is done.
	$output = insert($xml); 
	//print($output->asXML()); //TODO: turn this back on
?>
{'fraction_non_alphanumeric': 0.1511175898931001, 'fraction_numerical': 0.001943634596695821, 'mean_word_length': 3.3256302521008405, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 2, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 19}, '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': '3571711', 'n_tokens_mistral': 729, 'n_tokens_neox': 647, 'n_words': 225}