<commit_before><?php
/**
 * Module file
 *
 * This file defines abstract class Module whose provides basic modules functionality.
 * @author <NAME> <<EMAIL>>
 * @copyright Copyright &copy; 2006, Telaxus LLC
 * @license SPL
 * @version 1.0
 * @package epesi-base
 */
defined("_VALID_ACCESS") || die('Direct access forbidden');

/**
 * This class provides some basic functionality for every epesi module.
 * @package epesi-base
 * @subpackage module
 */
abstract class Module extends ModulePrimitive {
	protected $parent = null;
	protected $children = array();
	private $jses = array();
	private $instance;
	private $children_count_display;
	private $type_with_submodule;
	private $path;
	private $reload = null;
	private $fast_process = false;
	private $frozen_modules = array();
	private $inline_display = false;
	private $displayed = false;
	private $clear_child_vars = false;
	public $display_func = false;

	/**
	 * Constructor. Should not be called directly using new Module('name').
	 * Use $this->pack_module or $this->init_module (inside other module).
	 *
	 * @param string $type Module name with submodule class delimited with hash
	 * @param Module|null $parent Parent module
	 * @param mixed $name Unique instance name. If null, then it will be generated
	 * @param bool $clear_vars Clear module variables
	 *
	 * @throws Exception Exception is thrown, when instance id cannot be generated.
	 */
	public final function __construct($type,$parent,$name,$clear_vars) {
		$submodule_delimiter = strpos($type, '#');
		$this->type_with_submodule = $main_module = $type;
		if ($submodule_delimiter !== false) {
			$main_module = substr($type, 0, $submodule_delimiter);
		}
		parent::__construct($main_module);
		if($parent) {
			$this->parent = & $parent;
			if(isset($name))
				$this->instance = (string)$name;
			else
				$this->instance = $parent->get_new_child_instance_id($this->type_with_submodule);
			$parent->register_child($this);
		} elseif(isset($name))
			$this->instance = (string)$name;
		$this->path = null;
		if(!isset($this->instance)) throw new Exception('No instance name or parent specified.');
		$this->children_count_display = 0;
		if($clear_vars) {<commit_msg>module unique name should not contain characters other than A-Z,0-9<commit_after><?php
/**
 * Module file
 *
 * This file defines abstract class Module whose provides basic modules functionality.
 * @author <NAME> <<EMAIL>>
 * @copyright Copyright &copy; 2006, Telaxus LLC
 * @license SPL
 * @version 1.0
 * @package epesi-base
 */
defined("_VALID_ACCESS") || die('Direct access forbidden');

/**
 * This class provides some basic functionality for every epesi module.
 * @package epesi-base
 * @subpackage module
 */
abstract class Module extends ModulePrimitive {
	protected $parent = null;
	protected $children = array();
	private $jses = array();
	private $instance;
	private $children_count_display;
	private $type_with_submodule;
	private $path;
	private $reload = null;
	private $fast_process = false;
	private $frozen_modules = array();
	private $inline_display = false;
	private $displayed = false;
	private $clear_child_vars = false;
	public $display_func = false;

	/**
	 * Constructor. Should not be called directly using new Module('name').
	 * Use $this->pack_module or $this->init_module (inside other module).
	 *
	 * @param string $type Module name with submodule class delimited with hash
	 * @param Module|null $parent Parent module
	 * @param mixed $name Unique instance name. If null, then it will be generated
	 * @param bool $clear_vars Clear module variables
	 *
	 * @throws Exception Exception is thrown, when instance id cannot be generated.
	 */
	public final function __construct($type,$parent,$name,$clear_vars) {
		$submodule_delimiter = strpos($type, '#');
		$this->type_with_submodule = $main_module = $type;
		if ($submodule_delimiter !== false) {
			$main_module = substr($type, 0, $submodule_delimiter);
		}
		parent::__construct($main_module);
		if($parent) {
			$this->parent = & $parent;
			if(isset($name))
				$this->instance = (string)preg_replace('/[^A-Z0-9\_]+/i','_',$name);
			else
				$this->instance = $parent->get_new_child_instance_id($this->type_with_submodule);
			$parent->register_child($this);
		} elseif(isset($name))
			$this->instance = (string)$name;
		$this->path = null;
		if(!isset($this->instance)) throw new Exception('No instance name or parent specified.');
		$this->children_count_display = 0;
		if($clear_vars) {
{'fraction_non_alphanumeric': 0.13115487914055507, 'fraction_numerical': 0.004476275738585497, 'mean_word_length': 4.7368421052631575, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 35, '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': '6392945', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1323, 'n_words': 403}