<commit_before><?php
class SEO {

	private static $_path = null;
	private static $_default = null;

	/**
	 * -------------------------------------------------------------------------
	 * TODO
	 * -------------------------------------------------------------------------
	 */
	public static function check_path()
	{
		if($default_data = SEO_Model::get_default_path())
			self::$_default = $default_data;

		if($path_data = SEO_Model::get_by_path(Router::current_path()))
			self::$_path = $path_data;
	}

	/**
	 * -------------------------------------------------------------------------
	 * TODO
	 * -------------------------------------------------------------------------
	 */
	public static function title()
	{
		$title = null;
		$using_default = false;
		$path_data = Path::get_path_data(); // Used for setting the title based on the current path

		if(!is_null(self::$_path) && strlen(self::$_path['title']))
			$title = self::$_path['title'];

		elseif(isset($path_data['title']) && strlen($path_data['title']))
			$title = $path_data['title'];

		elseif(!is_null(self::$_default))
		{
			$using_default = true;
			$title = self::$_default['title'];
		}

		// If we arent using default, append and prepend values to title, if any
		if(!$using_default && !is_null(self::$_default))
			$title = self::$_default['prepend'] . $title . self::$_default['append'];

		return $title;
	}
	
	/**
	 * -------------------------------------------------------------------------
	 * TODO
	 * -------------------------------------------------------------------------
	 */
	public static function meta() 
	{
		print_r(Path::get_paths());

		$meta = array();

		if(!is_null(self::$_path))
		{
			foreach(self::$_path['meta'] as $m)
			{
				$key = strtolower($m['name']);
				$meta[$key] = $m;
			}
		}

		if(!is_null(self::$_default))
		{
			foreach(self::$_default['meta'] as $m)
			{<commit_msg>Forgot to disable array dump in SEO module. :)<commit_after><?php
class SEO {

	private static $_path = null;
	private static $_default = null;

	/**
	 * -------------------------------------------------------------------------
	 * TODO
	 * -------------------------------------------------------------------------
	 */
	public static function check_path()
	{
		if($default_data = SEO_Model::get_default_path())
			self::$_default = $default_data;

		if($path_data = SEO_Model::get_by_path(Router::current_path()))
			self::$_path = $path_data;
	}

	/**
	 * -------------------------------------------------------------------------
	 * TODO
	 * -------------------------------------------------------------------------
	 */
	public static function title()
	{
		$title = null;
		$using_default = false;
		$path_data = Path::get_path_data(); // Used for setting the title based on the current path

		if(!is_null(self::$_path) && strlen(self::$_path['title']))
			$title = self::$_path['title'];

		elseif(isset($path_data['title']) && strlen($path_data['title']))
			$title = $path_data['title'];

		elseif(!is_null(self::$_default))
		{
			$using_default = true;
			$title = self::$_default['title'];
		}

		// If we arent using default, append and prepend values to title, if any
		if(!$using_default && !is_null(self::$_default))
			$title = self::$_default['prepend'] . $title . self::$_default['append'];

		return $title;
	}
	
	/**
	 * -------------------------------------------------------------------------
	 * TODO
	 * -------------------------------------------------------------------------
	 */
	public static function meta() 
	{
		$meta = array();

		if(!is_null(self::$_path))
		{
			foreach(self::$_path['meta'] as $m)
			{
				$key = strtolower($m['name']);
				$meta[$key] = $m;
			}
		}

		if(!is_null(self::$_default))
		{
			foreach(self::$_default['meta'] as $m)
			{
{'fraction_non_alphanumeric': 0.3799682034976153, 'fraction_numerical': 0.0, 'mean_word_length': 1.5301608579088473, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6844689', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1030, 'n_words': 205}