<commit_before><?
defined('C5_EXECUTE') or die("Access Denied.");
ini_set('display_errors', 1);
if (!ini_get('safe_mode')) {
	@set_time_limit(150);
}

date_default_timezone_set(@date_default_timezone_get());

define('UPLOAD_FILE_EXTENSIONS_ALLOWED','*.flv;*.jpg;*.gif;*.jpeg;*.ico;*.docx;*.xla;*.png;*.psd;*.swf;*.doc;*.txt;*.xls;*.xlsx;*.csv;*.pdf;*.tiff;*.rtf;*.m4a;*.mov;*.wmv;*.mpeg;*.mpg;*.wav;*.avi;*.m4v;*.mp4;*.mp3;*.qt;*.ppt;*.pptx;*.kml;*.xml');
if (!defined('DIR_FILES_UPLOADED')) {
	define('DIR_FILES_UPLOADED', DIR_FILES_UPLOADED_STANDARD);
}
if (!defined('DIR_FILES_TRASH')) {
	define('DIR_FILES_TRASH', DIR_FILES_TRASH_STANDARD);
}

define('DIR_FILES_INCOMING', DIR_FILES_UPLOADED . '/incoming');
define('DIR_FILES_UPLOADED_THUMBNAILS', DIR_FILES_UPLOADED . '/thumbnails');
define('DIR_FILES_UPLOADED_THUMBNAILS_LEVEL2', DIR_FILES_UPLOADED . '/thumbnails/level2');
define('DIR_FILES_UPLOADED_THUMBNAILS_LEVEL3', DIR_FILES_UPLOADED . '/thumbnails/level3');
define('DIR_FILES_AVATARS', DIR_FILES_UPLOADED . '/avatars');

class Concrete5_Controller_Install extends Controller {

	public $helpers = array('form', 'html');
	
	protected function getLocales() {
		Loader::library('3rdparty/Zend/Locale');
		$languages = Localization::getAvailableInterfaceLanguages();
		if (count($languages) > 0) { 
			array_unshift($languages, 'en_US');
		}
		$locales = array();
		foreach($languages as $lang) {
			$loc = new Zend_Locale($lang);
			$locales[$lang] = Zend_Locale::getTranslation($loc->getLanguage(), 'language', $lang);
		}
		return $locales;
	}
	
	public function view() {
		$locales = $this->getLocales();
		$this->set('locales', $locales);		
		$this->testAndRunInstall();		
	}
	
	public function setup() {
	
	}
	
	public function select_language() {
		
	}

	/** 
	 * Testing
	 */
	public function on_start() {
		if (isset($_POST['locale']) && $_POST['locale']) {
			define("ACTIVE_LOCALE", $_POST['locale']);
			$this->set('locale', $_POST['locale']);
		}
		require(DIR_BASE_CORE . '/config/file_types.php');
		Cache::disableCache();
		$this->setRequiredItems();
		$this->setOptionalItems();
		Loader::model('package/starting_point');

		if (file_exists(DIR_CONFIG_SITE . '/site.php')) {
			throw new Exception(t('concrete5 is already installed.'));
		}		
		if (!isset($_COOKIE['CONCRETE5_INSTALL_TEST'])) {
			setcookie('CONCRETE5_INSTALL_TEST', '1', 0, DIR_REL . '/');
		}
	}
	<commit_msg>bug fix in install<commit_after><?
defined('C5_EXECUTE') or die("Access Denied.");
ini_set('display_errors', 1);
if (!ini_get('safe_mode')) {
	@set_time_limit(150);
}

date_default_timezone_set(@date_default_timezone_get());

define('UPLOAD_FILE_EXTENSIONS_ALLOWED','*.flv;*.jpg;*.gif;*.jpeg;*.ico;*.docx;*.xla;*.png;*.psd;*.swf;*.doc;*.txt;*.xls;*.xlsx;*.csv;*.pdf;*.tiff;*.rtf;*.m4a;*.mov;*.wmv;*.mpeg;*.mpg;*.wav;*.avi;*.m4v;*.mp4;*.mp3;*.qt;*.ppt;*.pptx;*.kml;*.xml');
if (!defined('DIR_FILES_UPLOADED')) {
	define('DIR_FILES_UPLOADED', DIR_FILES_UPLOADED_STANDARD);
}
if (!defined('DIR_FILES_TRASH')) {
	define('DIR_FILES_TRASH', DIR_FILES_TRASH_STANDARD);
}

define('DIR_FILES_INCOMING', DIR_FILES_UPLOADED . '/incoming');
define('DIR_FILES_UPLOADED_THUMBNAILS', DIR_FILES_UPLOADED . '/thumbnails');
define('DIR_FILES_UPLOADED_THUMBNAILS_LEVEL2', DIR_FILES_UPLOADED . '/thumbnails/level2');
define('DIR_FILES_UPLOADED_THUMBNAILS_LEVEL3', DIR_FILES_UPLOADED . '/thumbnails/level3');
define('DIR_FILES_AVATARS', DIR_FILES_UPLOADED . '/avatars');

class Concrete5_Controller_Install extends Controller {

	public $helpers = array('form', 'html');
	
	protected function getLocales() {
		Loader::library('3rdparty/Zend/Locale');
		$languages = Localization::getAvailableInterfaceLanguages();
		if (count($languages) > 0) { 
			array_unshift($languages, 'en_US');
		}
		$locales = array();
		foreach($languages as $lang) {
			$loc = new Zend_Locale($lang);
			$locales[$lang] = Zend_Locale::getTranslation($loc->getLanguage(), 'language', $lang);
		}
		return $locales;
	}
	
	public function view() {
		$locales = $this->getLocales();
		$this->set('locales', $locales);		
		$this->testAndRunInstall();		
	}
	
	public function setup() {
	
	}
	
	public function select_language() {
		
	}

	/** 
	 * Testing
	 */
	public function on_start() {
		if (isset($_POST['locale']) && $_POST['locale']) {
			define("ACTIVE_LOCALE", $_POST['locale']);
			$this->set('locale', $_POST['locale']);
		}
		require(DIR_BASE_CORE . '/config/file_types.php');
		Cache::disableCache();
		Cache::disableLocalCache();
		$this->setRequiredItems();
		$this->setOptionalItems();
		Loader::model('package/starting_point');

		if (file_exists(DIR_CONFIG_SITE . '/site.php')) {
			throw new Exception(t('concrete5 is already installed.'));
		}		
		if (!isset($_COOKIE['CONCRETE5_INSTALL_TEST'])) {
			setcookie('CONCRETE5_INSTALL_TEST', '1', 0, DIR_REL . '/');
		}
	}
	
{'fraction_non_alphanumeric': 0.19966962626471196, 'fraction_numerical': 0.008672310551311171, 'mean_word_length': 6.01013024602026, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4251087', 'n_tokens_mistral': 2035, 'n_tokens_neox': 1886, 'n_words': 232}