<commit_before><?php 

/**
 * Static class to read constants from php ini
 * 
 * @author Ephigenia // <NAME> <<EMAIL>>
 * @since 26.05.2009
 */
class PHPINI
{
	/**
	 * Tries to read a $varname from the php ini and returns it’s value
	 * 
	 * @param string $varname
	 * @return string|boolean|integer
	 */
	public static function get($varname)
	{
		$value = ini_get($varname);
		if (!$value) {
			return false;
		}
		// try to see file size in var
		if (preg_match('@(\d+(.\d+)?)\s*(m|kb|g)@i', $value, $found)) {
			switch(strtolower($found[3])) {
				case 'm':
					$value = (float) $found[1] * MEGABYTE;
					break;
				case 'kb':
					$value = (float) $found[1] * KILOBYTE;
					break;
				case 'g':
					$value = (float) $found[1] * GIGABYTE;
					break;
			}
		// parse true/false values
		} elseif (preg_match('@(true|yes|1)@i', $value)) {
			$value = true;
		} elseif (preg_match('@(false|no|0)@i', $value)) {
			$value = false;
		}
		return $value;
	}
	
	/**
	 * Tries to write a config variable. If ini_set is disabled false is<commit_msg>PHPINI::get Fixed return value<commit_after><?php 

/**
 * Static class to read constants from php ini
 * 
 * @author Ephigenia // <NAME> <<EMAIL>>
 * @since 26.05.2009
 */
class PHPINI
{
	/**
	 * Tries to read a $varname from the php ini and returns it’s value
	 * 
	 * @param string $varname
	 * @return string|boolean|integer
	 */
	public static function get($varname)
	{
		$value = ini_get($varname);
		if (!$value) {
			return false;
		}
		// try to see file size in var
		if (preg_match('@^(\d+(.\d+)?)\s*(m|kb|g)?@i', $value, $found)) {
			$value = (float) $found[1];
			if (isset($found[3])) switch(strtolower($found[3])) {
				case 'm':
					$value = (float) $found[1] * MEGABYTE;
					break;
				case 'kb':
					$value = (float) $found[1] * KILOBYTE;
					break;
				case 'g':
					$value = (float) $found[1] * GIGABYTE;
					break;
			}
		// parse true/false values
		} elseif (preg_match('@^(true|yes|1)$@i', $value)) {
			$value = true;
		} elseif (preg_match('@^(false|no|0)$@i', $value)) {
			$value = false;
		}
		return $value;
	}
	
	/**
	 * Tries to write a config variable. If ini_set is disabled false is
{'fraction_non_alphanumeric': 0.18462246777163904, 'fraction_numerical': 0.013812154696132596, 'mean_word_length': 2.9725776965265083, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '4476284', 'n_tokens_mistral': 985, 'n_tokens_neox': 833, 'n_words': 217}