<commit_before><?php

$total_pages = 7;

// Define variables for PHP and the CMS
require_once('_hidden/php_script/define.php');

// This prevents the session from having problems on first login
ini_set('session.name', 'FLSETUP');

if(!isset($_SESSION)) session_start();

function cleanUp()
{
	unset($_SESSION);
	unset($_POST);
	session_destroy();
	session_start();
}

function final_action()
{
	if (isset($_SESSION['step'])) unset($_SESSION['step']);
	if (isset($_SESSION['finish'])) unset($_SESSION['finish']);

	$set = new file_array(CMS_FILE_SITE);
	foreach ($_SESSION as $key=>$val)
	{
		$set->add($key,$val);
	}
	$set->add('recorded_root',$_SERVER['DOCUMENT_ROOT']);

	if ($set->get('db_database')===false)
	{
		if ($set->get('recorded_domain')===false) $site_n = $_SERVER['HTTP_HOST'];
		else
		{
			$arr = explode('.',$set->get('recorded_domain'));
			if (count($arr)==3) $site_n = $arr[1];
			else $site_n = $_SERVER['HTTP_HOST'];
		}

		if (strlen(str_replace('.','',$site_n))>=16) $db_name = substr(str_replace('.','',$site_n),0,15);
		else $db_name = str_replace('.','',$site_n);
		$set->add('db_database',$db_name);

		$set->add('db_write_username',$db_name.'w');
		$set->add('db_write_password',md5(uniqid(rand(), TRUE)));
		$set->add('db_read_username',$db_name.'r');
		$set->add('db_read_password',md5(uniqid(rand(), TRUE)));
	}
	if ($set->get('unique_id')===false)
	{
		$set->add('unique_id','93a0f790450c2d24f07b8d59cf52c891');
	}

	cleanUp();
	header("Location: index.php");
	exit;
}

function build_content($arr)
{
	global $total_pages;
	if (count($arr)==5)
	{<commit_msg>Automatically updated by FusionLeaf Publisher<commit_after><?php

$total_pages = 7;

// Define variables for PHP and the CMS
require_once('_hidden/php_script/define.php');

// This prevents the session from having problems on first login
ini_set('session.name', 'FLSETUP');

if(!isset($_SESSION)) session_start();

function cleanUp()
{
	unset($_SESSION);
	unset($_POST);
	session_destroy();
	session_start();
}

function final_action()
{
	if (isset($_SESSION['step'])) unset($_SESSION['step']);
	if (isset($_SESSION['finish'])) unset($_SESSION['finish']);

	$set = new file_array(CMS_FILE_SITE);
	foreach ($_SESSION as $key=>$val)
	{
		$set->add($key,$val);
	}
	$set->add('recorded_root',$_SERVER['DOCUMENT_ROOT']);

	if ($set->get('db_database')===false)
	{
		if ($set->get('recorded_domain')===false) $site_n = $_SERVER['HTTP_HOST'];
		else
		{
			$arr = explode('.',$set->get('recorded_domain'));
			if (count($arr)==3) $site_n = $arr[1];
			else $site_n = $_SERVER['HTTP_HOST'];
		}


		// Remove any periods
		$site_n = str_replace('.','',$site_n);

		// If the database name is too long (SQL usernames are limited to 16 chars), take a substring
		if (strlen($site_n)>=12) $db_name = substr($site_n,0,11);
		else $db_name = $site_n;

		// Append a random character to make it hard to brute force the SQL accounts
		$db_name = $db_name.rand(1,9999);
		$set->add('db_database',$db_name);

		$set->add('db_write_username',$db_name.'w');
		$set->add('db_write_password',md5(uniqid(rand(), TRUE)));
		$set->add('db_read_username',$db_name.'r');
		$set->add('db_read_password',md5(uniqid(rand(), TRUE)));
	}
	if ($set->get('unique_id')===false)
	{
		$set->add('unique_id','93a0f790450c2d24f07b8d59cf52c891');
	}

	cleanUp();
	header("Location: index.php");
	exit;
}

function build_content($arr)
{
	global $total_pages;
	if (count($arr)==5)
	{
{'fraction_non_alphanumeric': 0.21526361782697348, 'fraction_numerical': 0.021264200407806584, 'mean_word_length': 6.036885245901639, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '4226447', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1300, 'n_words': 224}