<commit_before><?php
/**
 * The initializer class that is responsible for initializing singleton classes only when necessary.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */

// Don't load directly
if ( !defined( 'ABSPATH' ) ) {
	die( '-1' );
}

if ( !class_exists( 'Muut_Initializer' ) ) {

	/**
	 * Muut Initializer class.
	 *
	 * @package Muut
	 * @author  <NAME>
	 * @since   3.0
	 */
	class Muut_Initializer
	{
		/**
		 * @static
		 * @property Muut_Initializer The instance of the class.
		 */
		protected static $instance;

		/**
		 * @property array An array of classes that have already been initialized.
		 */
		protected $alreadyInit;

		/**
		 * The singleton method.
		 *
		 * @return Muut_Initializer The instance.
		 * @author <NAME>
		 * @since  3.0
		 */
		public static function instance() {
			if ( !is_a( self::$instance, __CLASS__ ) ) {
				self::$instance = new self();
			}
			return self::$instance;
		}

		/**
		 * The class constructor.
		 *
		 * @return Muut_Initializer
		 * @author <NAME>
		 * @since  3.0
		 */
		protected function __construct() {
			$this->alreadyInit = array();
			$this->addInitListeners();
		}

		/**
		 * Adds the main actions and filters (init listeners) for the plugin.
		 *
		 * @return void
		 * @author <NAME>
		 * @since  3.0
		 */
		protected function addInitListeners() {
			add_action( 'template_redirect', array( $this, 'initTemplateLoader' ) );
			add_action( 'init', array( $this, 'initForumPageUtility' ) );
			add_action( 'init', array( $this, 'initCommentOverrides' ) );
			add_filter( 'comments_template', array( $this, 'initTemplateLoader' ) );
		}

		/**
		 * Initializes the Template Loader class.
		 *
		 * @return void
		 * @author <NAME>
		 * @since 3.0
		 */
		public function initTemplateLoader() {
			$class = 'Muut_Template_Loader';
			if ( !in_array( $class, $this->alreadyInit ) ) {
				require_once( muut()->getPluginPath() . 'lib/template-loader.class.php');
				if ( class_exists( $class ) ) {
					$class::instance();
				}
				$this->alreadyInit[] = $class;
			}
		}

		/**
		 * Initializes the Forum Page utility.
		 *
		 * @return void
		 * @author <NAME>
		 * @since 3.0
		 */
		public function initForumPageUtility() {
			$class = 'Muut_Forum_Page_Utility';
			if ( !in_array( $class, $this->alreadyInit ) ) {
				require_once( muut()->getPluginPath() . 'lib/forum-page.utility.class.php');
				$this->alreadyInit[] = $class;
			}
		}

		/**
		 * Initializes the Comment Overrides class (when WP comments over overridden by Muut).
		 *
		 * @return void
		 * @author <NAME>
		 * @since 3.0
		 */
		public function initCommentOverrides() {
			$class = 'Muut_Comment_Overrides';
			if ( !in_array( $class, $this->alreadyInit ) && muut()->getOption( 'replace_comments', false ) ) {
				require_once( muut()->getPluginPath() . 'lib/comment-overrides.class.php');
				if ( class_exists( $class ) ) {
					$class::instance();
				}
				$this->alreadyInit[] = $class;
			}
		}
	}
}<commit_msg>Fixed an error in class reference call unsupported by PHP 5.2<commit_after><?php
/**
 * The initializer class that is responsible for initializing singleton classes only when necessary.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */

// Don't load directly
if ( !defined( 'ABSPATH' ) ) {
	die( '-1' );
}

if ( !class_exists( 'Muut_Initializer' ) ) {

	/**
	 * Muut Initializer class.
	 *
	 * @package Muut
	 * @author  <NAME>
	 * @since   3.0
	 */
	class Muut_Initializer
	{
		/**
		 * @static
		 * @property Muut_Initializer The instance of the class.
		 */
		protected static $instance;

		/**
		 * @property array An array of classes that have already been initialized.
		 */
		protected $alreadyInit;

		/**
		 * The singleton method.
		 *
		 * @return Muut_Initializer The instance.
		 * @author <NAME>
		 * @since  3.0
		 */
		public static function instance() {
			if ( !is_a( self::$instance, __CLASS__ ) ) {
				self::$instance = new self();
			}
			return self::$instance;
		}

		/**
		 * The class constructor.
		 *
		 * @return Muut_Initializer
		 * @author <NAME>
		 * @since  3.0
		 */
		protected function __construct() {
			$this->alreadyInit = array();
			$this->addInitListeners();
		}

		/**
		 * Adds the main actions and filters (init listeners) for the plugin.
		 *
		 * @return void
		 * @author <NAME>
		 * @since  3.0
		 */
		protected function addInitListeners() {
			add_action( 'template_redirect', array( $this, 'initTemplateLoader' ) );
			add_action( 'init', array( $this, 'initForumPageUtility' ) );
			add_action( 'init', array( $this, 'initCommentOverrides' ) );
			add_filter( 'comments_template', array( $this, 'initTemplateLoader' ) );
		}

		/**
		 * Initializes the Template Loader class.
		 *
		 * @return void
		 * @author <NAME>
		 * @since 3.0
		 */
		public function initTemplateLoader() {
			$class = 'Muut_Template_Loader';
			if ( !in_array( $class, $this->alreadyInit ) ) {
				require_once( muut()->getPluginPath() . 'lib/template-loader.class.php');
				if ( class_exists( $class ) ) {
					Muut_Template_Loader::instance();
				}
				$this->alreadyInit[] = $class;
			}
		}

		/**
		 * Initializes the Forum Page utility.
		 *
		 * @return void
		 * @author <NAME>
		 * @since 3.0
		 */
		public function initForumPageUtility() {
			$class = 'Muut_Forum_Page_Utility';
			if ( !in_array( $class, $this->alreadyInit ) ) {
				require_once( muut()->getPluginPath() . 'lib/forum-page.utility.class.php');
				$this->alreadyInit[] = $class;
			}
		}

		/**
		 * Initializes the Comment Overrides class (when WP comments over overridden by Muut).
		 *
		 * @return void
		 * @author <NAME>
		 * @since 3.0
		 */
		public function initCommentOverrides() {
			$class = 'Muut_Comment_Overrides';
			if ( !in_array( $class, $this->alreadyInit ) && muut()->getOption( 'replace_comments', false ) ) {
				require_once( muut()->getPluginPath() . 'lib/comment-overrides.class.php');
				if ( class_exists( $class ) ) {
					Muut_Comment_Overrides::instance();
				}
				$this->alreadyInit[] = $class;
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.1521523178807947, 'fraction_numerical': 0.006622516556291391, 'mean_word_length': 2.9432114882506526, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 41, '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': '1042545', 'n_tokens_mistral': 2364, 'n_tokens_neox': 1959, 'n_words': 486}