<commit_before><?php
/**
* LoadAvg - Server Monitoring & Analytics
* http://www.loadavg.com
*
* Settings module interface
*
* @link https://github.com/loadavg/loadavg
* @author <NAME>
* @copyright 2014 Sputnik7
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
?>

<?php

//locate the PHP binary
$php_location = PHP_BINDIR . "/php";

?>


<?php
if (!$loadavg->isLoggedIn() && !LoadAvg::checkInstall()) {
	include('login.php');
}
else 
{
?>

	<?php
	if (isset($_POST['Run_Logger'])) {

		$loadavg->rebuildLogs();

		/* force reload settings page now */
		header('Location: '. '/public/index.php?page=settingslogger'  );
    }

	if (isset($_POST['update_settings'])) {

		/////////////////////////////////////////////////////////////////////
		//updates the general settings here as api settings are stored there

		// Loop throught settings
		$settings_file = APP_PATH . '/config/' . LoadAvg::$settings_ini;
		
		$settings = LoadAvg::$_settings->general;

		$postsettings = $_POST['formsettings'];

		//$mergedsettings = LoadAvg::ini_merge ($settings, $postsettings);
		$replaced_settings = array_replace($settings, $postsettings);

		//LoadAvg::write_php_ini($mergedsettings, $settings_file);
		LoadAvg::write_php_ini($replaced_settings, $settings_file);

		//reload page
		header('Location: '. '/public/index.php?page=settingslogger'  );

	}
	?>

	<div class="innerAll">

		<div class="well">
		  		<h4>Logger</h4>
		</div>

	  	<div class="separator bottom"></div>

		<div class="well">

		    <div class="pull-right">
				<?php
				$logger_Status = false;
				$logger_Status = $loadavg->testLogs(false);
				?>
				Logger Status:
				<?php   
				if ($logger_Status == true) {
					echo "<strong>Running</strong>";
				} else {
					echo "<strong>Not Running</strong>";
				}
				?>
		    </div>

			<b>Logging in LoadAvg <?php echo $settings['version']; ?></b><commit_msg>updated logger settings<commit_after><?php
/**
* LoadAvg - Server Monitoring & Analytics
* http://www.loadavg.com
*
* Settings module interface
*
* @link https://github.com/loadavg/loadavg
* @author <NAME>
* @copyright 2014 Sputnik7
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
?>

<?php

//locate the PHP binary
$php_location = PHP_BINDIR . "/php";

?>


<?php
if (!$loadavg->isLoggedIn() && !LoadAvg::checkInstall()) {
	include('login.php');
}
else 
{
?>

	<?php
	if (isset($_POST['Run_Logger'])) {

		$loadavg->rebuildLogs();

		/* force reload settings page now */
		header('Location: '. '/public/index.php?page=settingslogger'  );
    }

	if (isset($_POST['update_settings'])) {

		/////////////////////////////////////////////////////////////////////
		//updates the general settings here as api settings are stored there

		// Loop throught settings
		$settings_file = APP_PATH . '/config/' . LoadAvg::$settings_ini;
		
		$settings = LoadAvg::$_settings->general;

		$postsettings = $_POST['formsettings'];

		//$mergedsettings = LoadAvg::ini_merge ($settings, $postsettings);
		$replaced_settings = array_replace($settings, $postsettings);

		//LoadAvg::write_php_ini($mergedsettings, $settings_file);
		LoadAvg::write_php_ini($replaced_settings, $settings_file);

		/* force reload settings page now */

		//echo 'URI ' . $_SERVER['REQUEST_URI'] ;
		header('Location: '.$_SERVER['REQUEST_URI']);
		//header('Location: '. '/public/index.php?page=settingslogger'  );

	}
	?>

	<div class="innerAll">

		<div class="well">
		  		<h4>Logger</h4>
		</div>

	  	<div class="separator bottom"></div>

		<div class="well">

		    <div class="pull-right">
				<?php
				$logger_Status = false;
				$logger_Status = $loadavg->testLogs(false);
				?>
				Logger Status:
				<?php   
				if ($logger_Status == true) {
					echo "<strong>Running</strong>";
				} else {
					echo "<strong>Not Running</strong>";
				}
				?>
		    </div>

			<b>Logging in LoadAvg <?php echo $settings['version']; ?></b>
{'fraction_non_alphanumeric': 0.2026754164563352, 'fraction_numerical': 0.004038364462392731, 'mean_word_length': 3.1847940865892292, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 59, 'https://': 2, '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': '4123372', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1262, 'n_words': 273}