<commit_before><?php

/*©mit**************************************************************************
*                                                                              *
* This file is part of FRIEND UNIFYING PLATFORM.                               *
* Copyright (c) Friend Software Labs AS. All rights reserved.                  *
*                                                                              *
* Licensed under the Source EULA. Please refer to the copy of the MIT License, *
* found in the file license_mit.txt.                                           *
*                                                                              *
*****************************************************************************©*/

// Connects to friend core and builds the query at the same time
function FriendCoreQuery( $command = '', $args = false, $method = 'POST', $headers = false, $conf = false )
{
	global $Config;
	
	if( !$conf ) $conf = $Config;
	
	$curl = curl_init();
	
	$server = ( $conf->SSLEnable ? 'https://' : 'http://' ) . $conf->FCHost . ( $conf->FCHost == 'localhost' && $conf->FCPort ? ':' . $conf->FCPort : '' );
	
	$url = ( $server . $command );
	
	if( $url && strstr( $url, '?' ) )
	{
		$thispath = $url;
		$url = explode( '?', $url );
	
		if( isset( $url[1] ) )
		{
			if( strstr( $url[1], '&' ) && strstr( $url[1], '=' ) )<commit_msg>Use localhost if it's defined.<commit_after><?php

/*©mit**************************************************************************
*                                                                              *
* This file is part of FRIEND UNIFYING PLATFORM.                               *
* Copyright (c) Friend Software Labs AS. All rights reserved.                  *
*                                                                              *
* Licensed under the Source EULA. Please refer to the copy of the MIT License, *
* found in the file license_mit.txt.                                           *
*                                                                              *
*****************************************************************************©*/

// Connects to friend core and builds the query at the same time
function FriendCoreQuery( $command = '', $args = false, $method = 'POST', $headers = false, $conf = false )
{
	global $Config;
	
	if( !$conf ) $conf = $Config;
	
	$curl = curl_init();
	
	$host = $conf->FCHost;
	if( isset( $Config[ 'FriendCore' ][ 'fconlocalhost' ] ) && $Config[ 'FriendCore' ][ 'fconlocalhost' ] == 1 )
	{
		$host = 'localhost';
	}
	
	$server = ( $conf->SSLEnable ? 'https://' : 'http://' ) . $conf->FCHost . ( $conf->FCHost == 'localhost' && $conf->FCPort ? ':' . $conf->FCPort : '' );
	
	$url = ( $server . $command );
	
	if( $url && strstr( $url, '?' ) )
	{
		$thispath = $url;
		$url = explode( '?', $url );
	
		if( isset( $url[1] ) )
		{
			if( strstr( $url[1], '&' ) && strstr( $url[1], '=' ) )
{'fraction_non_alphanumeric': 0.24354619565217392, 'fraction_numerical': 0.002377717391304348, 'mean_word_length': 1.6436265709156195, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3272021', 'n_tokens_mistral': 819, 'n_tokens_neox': 761, 'n_words': 215}