<commit_before><?php

// TODO: check for a better way to get the root of the opencart installation
define ( 'OC_ROOT', "/var/www/html/" . getenv('OPENCART_VERSION') .  "/upload/" );
class OpenCartTest extends PHPUnit_Framework_TestCase {
	protected $registry;
	protected $front;
	public static $_OPENCART = OC_ROOT;
	public static function getConfigurationPath() {
		$admin = strpos ( get_called_class (), "AdminTest" );
		return self::$_OPENCART . ($admin === false ? '' : 'admin/') . 'config.php';
	}
	public function __get($key) {
		return $this->registry->get ( $key );
	}
	public function __set($key, $value) {
		$this->registry->set ( $key, $value );
	}
	public function loadConfiguration() {
		
		// either load admin or catalog config.php
		$path = self::getConfigurationPath ();
		
		// Configuration
		if (file_exists ( $path )) {
			require_once ($path);
		} else {
			throw new Exception ( 'OpenCart has to be installed first!' .  $_ENV['OPENCART_VERSION'] . '.' );
		}
	}
	public function __construct() {
		$this->loadConfiguration ();
		
		// Startup
		require_once (DIR_SYSTEM . 'startup.php');
		
		// Application Classes
		require_once (DIR_SYSTEM . 'library/customer.php');
		require_once (DIR_SYSTEM . 'library/affiliate.php');
		require_once (DIR_SYSTEM . 'library/currency.php');
		require_once (DIR_SYSTEM . 'library/tax.php');
		require_once (DIR_SYSTEM . 'library/weight.php');
		require_once (DIR_SYSTEM . 'library/length.php');
		require_once (DIR_SYSTEM . 'library/cart.php');
		
		// Registry
		$this->registry = new Registry ();
		
		// Loader
		$loader = new Loader ( $this->registry );
		$this->registry->set ( 'load', $loader );
		
		// Config
		$config = new Config ();
		$this->registry->set ( 'config', $config );
		
		// Database
		$db = new DB ( DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE );<commit_msg>fixing version issue<commit_after><?php

// TODO: check for a better way to get the root of the opencart installation
define ( 'OC_ROOT', "/var/www/html/" . getenv('OPENCART_VERSION') .  "/upload/" );
class OpenCartTest extends PHPUnit_Framework_TestCase {
	protected $registry;
	protected $front;
	public static $_OPENCART = OC_ROOT;
	public static function getConfigurationPath() {
		$admin = strpos ( get_called_class (), "AdminTest" );
		return self::$_OPENCART . ($admin === false ? '' : 'admin/') . 'config.php';
	}
	public function __get($key) {
		return $this->registry->get ( $key );
	}
	public function __set($key, $value) {
		$this->registry->set ( $key, $value );
	}
	public function loadConfiguration() {
		
		// either load admin or catalog config.php
		$path = self::getConfigurationPath ();
		
		// Configuration
		if (file_exists ( $path )) {
			require_once ($path);
		} else {
			throw new Exception ( 'OpenCart has to be installed first!' .  $_OPENCART . '.' );
		}
	}
	public function __construct() {
		$this->loadConfiguration ();
		
		// Startup
		require_once (DIR_SYSTEM . 'startup.php');
		
		// Application Classes
		require_once (DIR_SYSTEM . 'library/customer.php');
		require_once (DIR_SYSTEM . 'library/affiliate.php');
		require_once (DIR_SYSTEM . 'library/currency.php');
		require_once (DIR_SYSTEM . 'library/tax.php');
		require_once (DIR_SYSTEM . 'library/weight.php');
		require_once (DIR_SYSTEM . 'library/length.php');
		require_once (DIR_SYSTEM . 'library/cart.php');
		
		// Registry
		$this->registry = new Registry ();
		
		// Loader
		$loader = new Loader ( $this->registry );
		$this->registry->set ( 'load', $loader );
		
		// Config
		$config = new Config ();
		$this->registry->set ( 'config', $config );
		
		// Database
		$db = new DB ( DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE );
{'fraction_non_alphanumeric': 0.15417789757412398, 'fraction_numerical': 0.0, 'mean_word_length': 3.691529709228824, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4418889', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1168, 'n_words': 294}