<commit_before><?php
class __USE_STATIC_ACCESS__HTTP implements HTTPInterface
{
	//----------------------------------------------------------------------------------------------------
	//
	// Yazar      : <NAME> <<EMAIL>> | <<EMAIL>>
	// Site       : www.zntr.net
	// Lisans     : The MIT License
	// Telif Hakkı: Copyright (c) 2012-2016, zntr.net
	//
	//----------------------------------------------------------------------------------------------------
	
	//----------------------------------------------------------------------------------------------------
	// Config
	//----------------------------------------------------------------------------------------------------
	// 
	// @var array
	//
	//----------------------------------------------------------------------------------------------------
	protected $config;
	
	//----------------------------------------------------------------------------------------------------
	// Settings
	//----------------------------------------------------------------------------------------------------
	// 
	// @var array
	//
	//----------------------------------------------------------------------------------------------------
	protected $settings;
	
	//----------------------------------------------------------------------------------------------------
	// Types
	//----------------------------------------------------------------------------------------------------
	// 
	// @var array
	//
	//----------------------------------------------------------------------------------------------------
	protected $types = array
	(
		'post',
		'get',
		'env',
		'server',
		'request'
	);
	
	public function __construct($config = array())
	{
		$this->config = Config::get('Services', 'http');	
	}
	
	//----------------------------------------------------------------------------------------------------
	// Call Undefined Method
	//----------------------------------------------------------------------------------------------------
	// 
	// __call()
	//
	//----------------------------------------------------------------------------------------------------
	use CallUndefinedMethodTrait;
	
	//----------------------------------------------------------------------------------------------------
	// Is Ajax
	//----------------------------------------------------------------------------------------------------
	// 
	// @param void
	//
	//----------------------------------------------------------------------------------------------------
	public function isAjax()
	{
		if( isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest')
		{
			return true;
		} 
		else 
		{
			return false;
		}
	}
	
	//----------------------------------------------------------------------------------------------------
	// Browser Lang
	//----------------------------------------------------------------------------------------------------
	// 
	// @param string $default tr
	// @param void
	//
	//----------------------------------------------------------------------------------------------------
	public function browserLang($default = 'tr')
	{
		$languages = Config::get('Language', 'shortCodes');
		
		$lang = strtolower(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2));
		
		if( isset($languages[$lang]) )
		{
			return strtolower($lang);
		}
	
		return $default;
	}

	//----------------------------------------------------------------------------------------------------
	// Code
	//----------------------------------------------------------------------------------------------------
	// 
	// @param numeric $code
	//
	//----------------------------------------------------------------------------------------------------
	public function code($code = 200)
	{
		$messages = Arrays::multikey($this->config['messages']);
		
		if( isset($messages[$code]) )
		{
			return $messages[$code];	
		}
		
		return false;
	}
	
	//----------------------------------------------------------------------------------------------------
	// Message
	//----------------------------------------------------------------------------------------------------
	// 
	// @param string $message
	//
	//----------------------------------------------------------------------------------------------------
	public function message($message = '')
	{
		return $this->code($message);
	}
	<commit_msg>zeroneed 3.0.2 update<commit_after><?php
class __USE_STATIC_ACCESS__HTTP implements HTTPInterface
{
	//----------------------------------------------------------------------------------------------------
	//
	// Yazar      : <NAME> <<EMAIL>> | <<EMAIL>>
	// Site       : www.zntr.net
	// Lisans     : The MIT License
	// Telif Hakkı: Copyright (c) 2012-2016, zntr.net
	//
	//----------------------------------------------------------------------------------------------------
	
	//----------------------------------------------------------------------------------------------------
	// Config
	//----------------------------------------------------------------------------------------------------
	// 
	// @var array
	//
	//----------------------------------------------------------------------------------------------------
	protected $config;
	
	//----------------------------------------------------------------------------------------------------
	// Settings
	//----------------------------------------------------------------------------------------------------
	// 
	// @var array
	//
	//----------------------------------------------------------------------------------------------------
	protected $settings;
	
	//----------------------------------------------------------------------------------------------------
	// Types
	//----------------------------------------------------------------------------------------------------
	// 
	// @var array
	//
	//----------------------------------------------------------------------------------------------------
	protected $types = array
	(
		'post',
		'get',
		'env',
		'server',
		'request'
	);
	
	public function __construct($config = array())
	{
		$this->config = Config::get('Services', 'http');	
	}
	
	//----------------------------------------------------------------------------------------------------
	// Call Undefined Method
	//----------------------------------------------------------------------------------------------------
	// 
	// __call()
	//
	//----------------------------------------------------------------------------------------------------
	use CallUndefinedMethodTrait;
	
	//----------------------------------------------------------------------------------------------------
	// Is Ajax
	//----------------------------------------------------------------------------------------------------
	// 
	// @param void
	//
	//----------------------------------------------------------------------------------------------------
	public function isAjax()
	{
		if( isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest')
		{
			return true;
		} 
		else 
		{
			return false;
		}
	}
	
	//----------------------------------------------------------------------------------------------------
	// Browser Lang
	//----------------------------------------------------------------------------------------------------
	// 
	// @param string $default tr
	// @param void
	//
	//----------------------------------------------------------------------------------------------------
	public function browserLang($default = 'tr')
	{
		if( ! is_string($default)) 
		{
			return Error::set('Error', 'stringParameter', '1.(default)');
		}
		
		$languages = Config::get('Language', 'shortCodes');
		
		$lang = strtolower(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2));
		
		if( isset($languages[$lang]) )
		{
			return strtolower($lang);
		}
	
		return $default;
	}

	//----------------------------------------------------------------------------------------------------
	// Code
	//----------------------------------------------------------------------------------------------------
	// 
	// @param numeric $code
	//
	//----------------------------------------------------------------------------------------------------
	public function code($code = 200)
	{
		if( ! is_scalar($code)) 
		{
			return Error::set('Error', 'scalarParameter', '1.(code)');
		}
		
		$messages = Arrays::multikey($this->config['messages']);
		
		if( isset($messages[$code]) )
		{
			return $messages[$code];	
		}
		
		return false;
	}
	
	//----------------------------------------------------------------------------------------------------
	// Message
	//----------------------------------------------------------------------------------------------------
	// 
	// @param string $message
	//
	//----------------------------------------------------------------------------------------------------
	public function message($message = '')
	{
		return $this->code($message);
	}
	
{'fraction_non_alphanumeric': 0.669066366704162, 'fraction_numerical': 0.003487064116985377, 'mean_word_length': 0.39248238057948315, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2124376', 'n_tokens_mistral': 1670, 'n_tokens_neox': 1483, 'n_words': 256}