<commit_before><?php

/**
 * 
 * Obsidian Moon Engine presented by Dark Prospect Games
 * @author Rev. <NAME>, III
 * @copyright (c) 2011
 * 
 */
class ObsidianMoonCore {

	public $output;
	public $systime;
	public $is_ajax;
	public $error;

	public function __construct($conf = null) {
		$this->systime = time();
		if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
			$this->is_ajax = true;
		}
		// Assign all configuration values to $conf_**** variables
		if (isset($conf) && is_array($conf)) {
			foreach ($conf as $key => $value) {
				$var = 'conf_' . $key;
				$this->$var = $value;
			}
		}
		if (isset($conf['modules'])) {
			if (is_array($conf['modules'])) {
				$exception = NULL;
				try {
					$this->classes($conf['modules']);
				} catch (Exception $e) {
					$exception .= $e->getMessage() . "<br />\n";
				}
				if ($exception !== NULL) {
					throw new Exception($exception);
				}
			} else {
				try {
					if (is_numeric($key)):
						$this->classes($value);
					else:
						$this->classes($key, $value);
					endif;
				} catch (Exception $e) {
					throw new Exception($e->getMessage());
				}
			}
		}
	}

	function classes($classes, $alternate_name = "", $p3_cname = null) {
		/**
		 * This function will load classes as needed for the user to use.
		 * It will allow them to be accessible via $core->classname.
		 * 
		 * @param $class - This is the file and class name of the class being called.
		 * @param $alternate_name - This is what the user would like to name the variable if available.
		 */
		if (!is_array($classes)) {
			$classes = array($classes, array($alternate_name,$p3_cname));
		}
		foreach ($classes as $class => $alternate_name) {
			if (is_array($alternate_name))
				list($alternate_name,$p3_cname) = $alternate_name;
			if (is_numeric($class))
				$class = $alternate_name;
			if (preg_match('/\//', $class)) {
				$class_name = end(explode('/', $class));
			} elseif ($p3_cname !== null) {
				$class_name = $p3_cname;
			} else {
				$class_name = $class;
			}

			if (preg_match('/^core\//', $class))
				$classes_location = $this->conf_core . 'classes/' . $class_name . '.php';
			elseif (preg_match('/^third_party\//', $class))
				$classes_location = $this->conf_libs . $class . '.php';
			else
				$classes_location = $this->conf_libs . 'classes/' . $class . '.php';
			$configs_location = $this->conf_libs . 'configs/' . $class . '.php';
			if (file_exists($classes_location)) {
				include($classes_location);
				if (class_exists($class_name)) {
					if (file_exists($configs_location)) {
						include($configs_location);
					}
					if ($alternate_name == "") {
						$alternate_name = $class_name;
					}<commit_msg>Fixed a formatting issue in core file. Signed-off-by:<NAME> <<EMAIL>><commit_after><?php

/**
 * 
 * Obsidian Moon Engine presented by Dark Prospect Games
 * @author Rev. <NAME>, III
 * @copyright (c) 2011
 * 
 */
class ObsidianMoonCore {

	public $output;
	public $systime;
	public $is_ajax;
	public $error;

	public function __construct($conf = null) {
		$this->systime = time();
		if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
			$this->is_ajax = true;
		}
		// Assign all configuration values to $conf_**** variables
		if (isset($conf) && is_array($conf)) {
			foreach ($conf as $key => $value) {
				$var = 'conf_' . $key;
				$this->$var = $value;
			}
		}
		if (isset($conf['modules'])) {
			if (is_array($conf['modules'])) {
				$exception = NULL;
				try {
					$this->classes($conf['modules']);
				} catch (Exception $e) {
					$exception .= $e->getMessage() . "<br />\n";
				}
				if ($exception !== NULL) {
					throw new Exception($exception);
				}
			} else {
				try {
					if (is_numeric($key)):
						$this->classes($value);
					else:
						$this->classes($key, $value);
					endif;
				} catch (Exception $e) {
					throw new Exception($e->getMessage());
				}
			}
		}
	}

	function classes($classes, $alternate_name = "", $p3_cname = null) {
		/**
		 * This function will load classes as needed for the user to use.
		 * It will allow them to be accessible via $core->classname.
		 * 
		 * @param $class - This is the file and class name of the class being called.
		 * @param $alternate_name - This is what the user would like to name the variable if available.
		 */
		if (!is_array($classes)) {
			$classes = array($classes, array($alternate_name, $p3_cname));
		}
		foreach ($classes as $class => $alternate_name) {
			if (is_array($alternate_name))
				list($alternate_name, $p3_cname) = $alternate_name;
			if (is_numeric($class))
				$class = $alternate_name;
			if (preg_match('/\//', $class)) {
				$class_name = end(explode('/', $class));
			} elseif ($p3_cname !== null) {
				$class_name = $p3_cname;
			} else {
				$class_name = $class;
			}

			if (preg_match('/^core\//', $class))
				$classes_location = $this->conf_core . 'classes/' . $class_name . '.php';
			elseif (preg_match('/^third_party\//', $class))
				$classes_location = $this->conf_libs . $class . '.php';
			else
				$classes_location = $this->conf_libs . 'classes/' . $class . '.php';
			$configs_location = $this->conf_libs . 'configs/' . $class . '.php';
			if (file_exists($classes_location)) {
				include($classes_location);
				if (class_exists($class_name)) {
					if (file_exists($configs_location)) {
						include($configs_location);
					}
					if ($alternate_name == "") {
						$alternate_name = $class_name;
					}
{'fraction_non_alphanumeric': 0.17579250720461095, 'fraction_numerical': 0.0032420749279538905, 'mean_word_length': 3.156437125748503, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5283622', 'n_tokens_mistral': 2283, 'n_tokens_neox': 1880, 'n_words': 448}