<commit_before><?
	class Loader {

		public function library($lib, $pkgHandle = null) {
			if ($pkgHandle) {
				require_once(DIR_LIBRARIES . '/' . $pkgHandle . '/' . DIRNAME_LIBRARIES . '/' . $lib . '.php');
			} else if (file_exists(DIR_LIBRARIES . '/' . $lib . '.php')) {
				require_once(DIR_LIBRARIES . '/' . $lib . '.php');
			} else {
				require_once(DIR_LIBRARIES_CORE . '/' . $lib . '.php');
			}
		}
		
		public function model($mod, $pkgHandle = null) {
			if ($pkgHandle) {
				require_once(DIR_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_MODELS . '/' . $mod . '.php');
			} else if (file_exists(DIR_MODELS . '/' . $mod . '.php')) {
				require_once(DIR_MODELS . '/' . $mod . '.php');
			} else {
				require_once(DIR_MODELS_CORE . '/' . $mod . '.php');
			}
		}
		
		public function packageElement($file, $pkgHandle, $args = null) {
			if (is_array($args)) {
				extract($args);
			}
			include(DIR_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_ELEMENTS . '/' . $file . '.php');
		}

		public function element($file, $args = null) {
			if (is_array($args)) {
				extract($args);
			}
			if (file_exists(DIR_FILES_ELEMENTS_CORE . '/' . $file . '.php')) {
				include(DIR_FILES_ELEMENTS_CORE . '/' . $file . '.php');
			} else {
				include(DIR_FILES_ELEMENTS . '/' . $file . '.php');
			}
		}
		
		public function block($bl) {
			if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $bl . '/' . FILENAME_BLOCK_CONTROLLER)) {
				require_once(DIR_FILES_BLOCK_TYPES . '/' . $bl . '/' . FILENAME_BLOCK_CONTROLLER);
			} else {
				require_once(DIR_FILES_BLOCK_TYPES_CORE . '/' . $bl . '/' . FILENAME_BLOCK_CONTROLLER);
			}
		}
		
		/* database loads the libraries needed to connect. DB Instantiates the object */
		public function database() {
			Loader::library('3rdparty/adodb/adodb.inc');
			//Loader::library('3rdparty/adodb/adodb-pear.inc');
			Loader::library('3rdparty/adodb/adodb-exceptions.inc');
			Loader::library('3rdparty/adodb/adodb-active-record.inc');
			Loader::library('3rdparty/adodb/adodb-xmlschema03.inc');
			Loader::library('database');
		}
		
		public function db($server = null, $username = null, $password = <PASSWORD>, $database = null) {
			static $_db;
			if (!isset($_db)) {
				if ($server == null && defined('DB_SERVER')) {	
					$dsn = DB_TYPE . '://' . DB_USERNAME . ':' . DB_PASSWORD . '@' . DB_SERVER . '/' . DB_DATABASE;
				} else if ($server) {
					$dsn = DB_TYPE . '://' . $username . ':' . $password . '@' . $server . '/' . $database;
				}

				if ($dsn) {
					$_dba = @NewADOConnection($dsn);
					if (is_object($_dba)) {
						ADOdb_Active_Record::SetDatabaseAdapter($_dba);
						$_db = new ConcreteDB();
						$_db->setDatabaseObject($_dba);
					}
				} else {
					return false;
				}
			}
			
			return $_db;
		}
		
		public function helper($file) {
			// loads and instantiates the object
			if (file_exists(DIR_HELPERS . '/' . $file . '.php')) {
				require_once(DIR_HELPERS . '/' . $file . '.php');
			} else {
				require_once(DIR_HELPERS_CORE . '/' . $file . '.php');
			}
			
			$class = Object::camelcase($file) . "Helper";
			$cl = new $class;
			return $cl;
		}
		
		public function package($file) {
			// loads and instantiates the object
			if (file_exists(DIR_PACKAGES . '/' . $file . '/' . FILENAME_PACKAGE_CONTROLLER)) {
				require_once(DIR_PACKAGES . '/' . $file . '/' . FILENAME_PACKAGE_CONTROLLER);
				$class = Object::camelcase($file) . "Package";
				$cl = new $class;
				return $cl;
			}
		}

		public function dashboardModuleController($dbhHandle, $pkg = null) {<commit_msg>der<commit_after><?
	class Loader {

		public function library($lib, $pkgHandle = null) {
			if ($pkgHandle) {
				require_once(DIR_LIBRARIES . '/' . $pkgHandle . '/' . DIRNAME_LIBRARIES . '/' . $lib . '.php');
			} else if (file_exists(DIR_LIBRARIES . '/' . $lib . '.php')) {
				require_once(DIR_LIBRARIES . '/' . $lib . '.php');
			} else {
				require_once(DIR_LIBRARIES_CORE . '/' . $lib . '.php');
			}
		}
		
		public function model($mod, $pkgHandle = null) {
			if ($pkgHandle) {
				require_once(DIR_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_MODELS . '/' . $mod . '.php');
			} else if (file_exists(DIR_MODELS . '/' . $mod . '.php')) {
				require_once(DIR_MODELS . '/' . $mod . '.php');
			} else {
				require_once(DIR_MODELS_CORE . '/' . $mod . '.php');
			}
		}
		
		public function packageElement($file, $pkgHandle, $args = null) {
			if (is_array($args)) {
				extract($args);
			}
			include(DIR_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_ELEMENTS . '/' . $file . '.php');
		}

		public function element($file, $args = null) {
			if (is_array($args)) {
				extract($args);
			}
			if (file_exists(DIR_FILES_ELEMENTS_CORE . '/' . $file . '.php')) {
				include(DIR_FILES_ELEMENTS_CORE . '/' . $file . '.php');
			} else {
				include(DIR_FILES_ELEMENTS . '/' . $file . '.php');
			}
		}
		
		public function block($bl) {
			if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $bl . '/' . FILENAME_BLOCK_CONTROLLER)) {
				require_once(DIR_FILES_BLOCK_TYPES . '/' . $bl . '/' . FILENAME_BLOCK_CONTROLLER);
			} else {
				require_once(DIR_FILES_BLOCK_TYPES_CORE . '/' . $bl . '/' . FILENAME_BLOCK_CONTROLLER);
			}
		}
		
		/* database loads the libraries needed to connect. DB Instantiates the object */
		public function database() {
			Loader::library('3rdparty/adodb/adodb.inc');
			//Loader::library('3rdparty/adodb/adodb-pear.inc');
			Loader::library('3rdparty/adodb/adodb-exceptions.inc');
			Loader::library('3rdparty/adodb/adodb-active-record.inc');
			Loader::library('3rdparty/adodb/adodb-xmlschema03.inc');
			Loader::library('database');
		}
		
		public function db($server = null, $username = null, $password = <PASSWORD>, $database = null) {
			static $_db;
			if (!isset($_db)) {
				if ($server == null && defined('DB_SERVER')) {	
					$dsn = DB_TYPE . '://' . DB_USERNAME . ':' . DB_PASSWORD . '@' . DB_SERVER . '/' . DB_DATABASE;
				} else if ($server) {
					$dsn = DB_TYPE . '://' . $username . ':' . $password . '@' . $server . '/' . $database;
				}

				if ($dsn) {
					$_dba = @NewADOConnection($dsn);
					if (is_object($_dba)) {
						ADOdb_Active_Record::SetDatabaseAdapter($_dba);
						$_db = new ConcreteDB();
						$_db->setDatabaseObject($_dba);
					}
				} else {
					return false;
				}
			}
			
			return $_db;
		}
		
		public function helper($file) {
			// loads and instantiates the object
			if (file_exists(DIR_HELPERS . '/' . $file . '.php')) {
				// first we check if there's an object of the SAME kind in the core. If so, then we load the core first, then, we load the second one (site)
				// and we hope the second one EXTENDS the first
				if (file_exists(DIR_HELPERS_CORE . '/' . $file . '.php')) {
					require_once(DIR_HELPERS_CORE . '/' . $file . '.php');
					require_once(DIR_HELPERS . '/' . $file . '.php');
					$class = "Site" . Object::camelcase($file) . "Helper";
				} else {
					require_once(DIR_HELPERS . '/' . $file . '.php');
					$class = Object::camelcase($file) . "Helper";
				}
			} else {
				require_once(DIR_HELPERS_CORE . '/' . $file . '.php');
				$class = Object::camelcase($file) . "Helper";
				
			}
			
			$cl = new $class;
			return $cl;
		}
		
		public function package($file) {
			// loads and instantiates the object
			if (file_exists(DIR_PACKAGES . '/' . $file . '/' . FILENAME_PACKAGE_CONTROLLER)) {
				require_once(DIR_PACKAGES . '/' . $file . '/' . FILENAME_PACKAGE_CONTROLLER);
				$class = Object::camelcase($file) . "Package";
				$cl = new $class;
				return $cl;
			}
		}

		public function dashboardModuleController($dbhHandle, $pkg = null) {
{'fraction_non_alphanumeric': 0.1872944890174931, 'fraction_numerical': 0.0018413784032618704, 'mean_word_length': 2.698443579766537, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6014838', 'n_tokens_mistral': 3336, 'n_tokens_neox': 2727, 'n_words': 500}