<commit_before><?php
/**
 * Fuel
 *
 * Fuel is a fast, lightweight, community driven PHP5 framework.
 *
 * @package		Fuel
 * @version		1.0
 * @author		Fuel Development Team
 * @license		MIT License
 * @copyright	2010 <NAME>
 * @link		http://fuelphp.com
 */

namespace Fuel;

class Config {
	
	public static $items = array();
	
	public static $flat_items = array();
	
	public static function load($file, $group = NULL)
	{
		$config = array();
		if ($path = Fuel::find_file('config', $file))
		{
			$config = Fuel::load($path);
		}
		if ($group === NULL)
		{
			static::$items = static::$items + $config;
		}
		else
		{
			if ( ! isset(static::$items[$group]))
			{
				static::$items[$group] = array();
			}
			static::$items[$group] = static::$items[$group] + $config;
		}
	}
	
	public static function get($item, $default = false)
	{
		if (strpos($item, '.') !== false)
		{
			$parts = explode('.', $item);

			$return = false;
			foreach ($parts as $part)
			{
				if ($return === false and isset(static::$items[$part]))
				{
					$return = static::$items[$part];
				}
				elseif (isset($return[$part]))
				{
					$return = $return[$part];
				}
				else
				{
					return false;
				}
			}
			return $return;
		}

		if (isset(static::$items[$item]))
		{
			return static::$items[$item];
		}
		return $default;
	}

	public static function set($item, $value)
	{
		$parts = explode('.', $item);
<commit_msg>Bugfix: Config::get() didn't return $default value when there was a dot in the item name<commit_after><?php
/**
 * Fuel
 *
 * Fuel is a fast, lightweight, community driven PHP5 framework.
 *
 * @package		Fuel
 * @version		1.0
 * @author		Fuel Development Team
 * @license		MIT License
 * @copyright	2010 <NAME>
 * @link		http://fuelphp.com
 */

namespace Fuel;

class Config {
	
	public static $items = array();
	
	public static $flat_items = array();
	
	public static function load($file, $group = NULL)
	{
		$config = array();
		if ($path = Fuel::find_file('config', $file))
		{
			$config = Fuel::load($path);
		}
		if ($group === NULL)
		{
			static::$items = static::$items + $config;
		}
		else
		{
			if ( ! isset(static::$items[$group]))
			{
				static::$items[$group] = array();
			}
			static::$items[$group] = static::$items[$group] + $config;
		}
	}
	
	public static function get($item, $default = false)
	{
		if (strpos($item, '.') !== false)
		{
			$parts = explode('.', $item);

			$return = false;
			foreach ($parts as $part)
			{
				if ($return === false and isset(static::$items[$part]))
				{
					$return = static::$items[$part];
				}
				elseif (isset($return[$part]))
				{
					$return = $return[$part];
				}
				else
				{
					return $default;
				}
			}
			return $return;
		}

		if (isset(static::$items[$item]))
		{
			return static::$items[$item];
		}
		return $default;
	}

	public static function set($item, $value)
	{
		$parts = explode('.', $item);

{'fraction_non_alphanumeric': 0.1871546961325967, 'fraction_numerical': 0.004834254143646409, 'mean_word_length': 2.995862068965517, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4484224', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1010, 'n_words': 244}