<commit_before><?php
	@include('settings.php');
	set_error_handler("ownWarning",E_WARNING);
	$extList = get_loaded_extensions();
	$phpVersion = explode(".", phpversion());
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html>
	<head>
		<title>Install ...</title>
		<style type='text/css'>
			table {margin-left:auto; margin-right:auto; font-size:12px; color:#fff; width:800px; background-color:#666; border:0px; border-collapse:collapse; border-spacing:0px;}
			table td {background-color:#CCC; color:#000; padding:4px; border:1px #fff solid;}
			table th {background-color:#666; color:#fff; padding:4px; text-align:left; border-bottom:2px #fff solid; font-size:12px; font-weight:bold;} 
		</style>
	</head>
	<body>

	<table summary="PHP settings">
		<tr> <th> PHP settings </th> <th> Value </th> <th> Result </th> </tr>
		<tr> <td> PHP version </td> <td> <?php echo phpversion(); ?> </td> <td> <?php showResult(($phpVersion[0] >= '5' && $phpVersion[1] >= 3), "", "PHP 5.3 or later is recommended"); ?>  </td> </tr>
		<tr> <td> timezone settings </td> <td> <?php echo ini_get("date.timezone"); ?> </td> <td> <?php showResult(ini_get("date.timezone"), "", "Please specify date.timezone in your PHP.ini"); ?> </td> </tr>
		<tr> <td> Open base dir </td> <td> <?php echo ini_get("open_basedir"); ?> </td> <td> <?php showResult(!ini_get("open_basedir"), "", "Niet leeg, <strong>kan</strong> een probleem zijn"); ?>  </td> </tr>
		<tr> <td> Allow furl open </td> <td> <?php echo ini_get("allow_url_fopen"); ?> </td> <td> <?php showResult(ini_get("allow_url_fopen") == 1, "", "allow_url_fopen not on -- will cause problems to retrieve external data"); ?> </td> </tr>
		<tr> <td> PHP safe mode </td> <td> <?php echo ini_get("safe_mode"); ?> </td> <td> <?php showResult(!ini_get("safe_mode"), "", "Safe mode set -- will cause problems for retrieve.php"); ?> </td> </tr>
		<tr> <td> Memory limit </td> <td> <?php echo ini_get("memory_limit"); ?> </td> <td> <?php showResult(return_bytes(ini_get("memory_limit")) >= (32*1024*1024), "", "memory_limit below 32M"); ?> </td> </tr>
	</table>
	
	<br />
	
	<table summary="PHP extensions">
		<tr> <th> PHP extension </th> <th> Result </th> </tr>
		<tr> <td> <?php echo $settings['db']['engine']; ?> </td> <td> <?php showResult(array_search($settings['db']['engine'], $extList) !== false, "", ""); ?> </td> </tr>
		<tr> <td> OpenSSL<br />Minimaal 1 moet OK zijn<br />In volgorde van snelste naar langzaamste<hr />Can create private key? </td> <td> <?php echo "openssl: "; showResult(array_search('openssl', $extList) !== false); echo "<br />";
			echo "gmp: "; showResult(array_search('gmp', $extList) !== false); echo "<br />";
			echo "bcmath: "; showResult(array_search('bcmath', $extList) !== false); echo "<hr />";
			require_once "lib/SpotSigning.php"; $spotSigning = new SpotSigning(); $privKey = $spotSigning->createPrivateKey($settings['openssl_cnf_path']); showResult(isset($privKey['public']) && !empty($privKey['public']) && !empty($privKey['private'])); ?> </td> </tr>
		<tr> <td> ctype </td> <td> <?php showResult(array_search('ctype', $extList) !== false); ?> </td> </tr>
		<tr> <td> xml </td> <td> <?php showResult(array_search('xml', $extList) !== false); ?> </td> </tr>
		<tr> <td> zlib </td> <td> <?php showResult(array_search('zlib', $extList) !== false); ?> </td> </tr>
		<tr> <td> GD </td> <td> <?php showResult(array_search('gd', $extList) !== false); ?> </td> </tr>
	</table>

	<br />
	
	<table summary="Include files">
		<tr> <th> Include files  </th> <th> Result </th> </tr>
		<tr> <td> Settings file </td> <td> <?php echo showResult(testInclude("settings.php"), testInclude("settings.php")); ?>  </td> </tr>
		<tr> <td> Own settings file </td> <td> <?php echo showResult(testInclude("ownsettings.php"), testInclude("ownsettings.php"), "optioneel"); ?>  </td> </tr>
		<tr> <td> PEAR </td> <td> <?php echo showResult(testInclude("System.php"), testInclude("System.php")); ?>  </td> </tr>
		<tr> <td> PEAR Net/NNTP </td> <td> <?php echo showResult(testInclude("Net/NNTP/Client.php"), testInclude("Net/NNTP/Client.php")); ?>  </td> </tr>
		<tr> <td> NNTP server </td> <td> <?php showResult(empty($settings['nntp_nzb']['host']) === false, $settings['nntp_nzb']['host'], "No server entered"); ?>  </td> </tr>
	</table>

	<br />

	<table summary="NZB handling">
<?php
	switch ($settings['nzbhandling']['action'] )
	{
		case "save":
		case "runcommand":
		case "push-sabnzbd":
			echo "<tr> <th> NZB local download enabled </th> <th> Value </th> </tr>";
			echo "<tr><td>NZB action: </td><td>" . $settings['nzbhandling']['action'] . "</td></tr>";
			echo "<tr><td>NZB directory: </td><td>" .$settings['nzbhandling']['local_dir'] ."</td></tr>";
			echo "<tr><td>Directory access: </td><td>";
			$TestFileName = $settings['nzbhandling']['local_dir'] ."testFile.txt";
			$TestFileHandle = fopen($TestFileName, 'w') or die("Cannot create file</td></tr>");
			showResult(true);
			echo "</td></tr>";
			fclose($TestFileHandle);
			unlink($TestFileName);<commit_msg>Fix #637<commit_after><?php
	@include('settings.php');
	set_error_handler("ownWarning",E_WARNING);
	$extList = get_loaded_extensions();
	$phpVersion = explode(".", phpversion());
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html>
	<head>
		<title>Install ...</title>
		<style type='text/css'>
			table {margin-left:auto; margin-right:auto; font-size:12px; color:#fff; width:800px; background-color:#666; border:0px; border-collapse:collapse; border-spacing:0px;}
			table td {background-color:#CCC; color:#000; padding:4px; border:1px #fff solid;}
			table th {background-color:#666; color:#fff; padding:4px; text-align:left; border-bottom:2px #fff solid; font-size:12px; font-weight:bold;} 
		</style>
	</head>
	<body>

	<table summary="PHP settings">
		<tr> <th> PHP settings </th> <th> Value </th> <th> Result </th> </tr>
		<tr> <td> PHP version </td> <td> <?php echo phpversion(); ?> </td> <td> <?php showResult(($phpVersion[0] >= '5' && $phpVersion[1] >= 3), "", "PHP 5.3 or later is recommended"); ?>  </td> </tr>
		<tr> <td> timezone settings </td> <td> <?php echo ini_get("date.timezone"); ?> </td> <td> <?php showResult(ini_get("date.timezone"), "", "Please specify date.timezone in your PHP.ini"); ?> </td> </tr>
		<tr> <td> Open base dir </td> <td> <?php echo ini_get("open_basedir"); ?> </td> <td> <?php showResult(!ini_get("open_basedir"), "", "Niet leeg, <strong>kan</strong> een probleem zijn"); ?>  </td> </tr>
		<tr> <td> Allow furl open </td> <td> <?php echo ini_get("allow_url_fopen"); ?> </td> <td> <?php showResult(ini_get("allow_url_fopen") == 1, "", "allow_url_fopen not on -- will cause problems to retrieve external data"); ?> </td> </tr>
		<tr> <td> PHP safe mode </td> <td> <?php echo ini_get("safe_mode"); ?> </td> <td> <?php showResult(!ini_get("safe_mode"), "", "Safe mode set -- will cause problems for retrieve.php"); ?> </td> </tr>
		<tr> <td> Memory limit </td> <td> <?php echo ini_get("memory_limit"); ?> </td> <td> <?php showResult(return_bytes(ini_get("memory_limit")) >= (32*1024*1024), "", "memory_limit below 32M"); ?> </td> </tr>
	</table>
	
	<br />
	
	<table summary="PHP extensions">
		<tr> <th> PHP extension </th> <th> Result </th> </tr>
		<tr> <td> <?php echo $settings['db']['engine']; ?> </td> <td> <?php showResult(array_search($settings['db']['engine'], $extList) !== false, "", ""); ?> </td> </tr>
		<tr> <td> OpenSSL<br />Minimaal 1 moet OK zijn<br />In volgorde van snelste naar langzaamste<hr />Can create private key? </td> <td> <?php echo "openssl: "; showResult(array_search('openssl', $extList) !== false); echo "<br />";
			echo "gmp: "; showResult(array_search('gmp', $extList) !== false); echo "<br />";
			echo "bcmath: "; showResult(array_search('bcmath', $extList) !== false); echo "<hr />";
			require_once "lib/SpotSigning.php"; $spotSigning = new SpotSigning(); $privKey = $spotSigning->createPrivateKey($settings['openssl_cnf_path']); showResult(isset($privKey['public']) && !empty($privKey['public']) && !empty($privKey['private'])); ?> </td> </tr>
		<tr> <td> ctype </td> <td> <?php showResult(array_search('ctype', $extList) !== false); ?> </td> </tr>
		<tr> <td> xml </td> <td> <?php showResult(array_search('xml', $extList) !== false); ?> </td> </tr>
		<tr> <td> zlib </td> <td> <?php showResult(array_search('zlib', $extList) !== false); ?> </td> </tr>
		<tr> <td> GD </td> <td> <?php showResult(array_search('gd', $extList) !== false); ?> </td> </tr>
	</table>

	<br />
	
	<table summary="Include files">
		<tr> <th> Include files  </th> <th> Result </th> </tr>
		<tr> <td> Settings file </td> <td> <?php echo showResult(testInclude("settings.php"), testInclude("settings.php")); ?>  </td> </tr>
		<tr> <td> Own settings file </td> <td> <?php echo showResult(testInclude("ownsettings.php"), testInclude("ownsettings.php"), "optioneel"); ?>  </td> </tr>
		<tr> <td> PEAR </td> <td> <?php echo showResult(testInclude("System.php"), testInclude("System.php")); ?>  </td> </tr>
		<?php if (PHP_OS == "WIN32" || PHP_OS == "WINNT") { ?>
			<tr> <td> PEAR Net/NNTP </td> <td> <?php echo showResult(testInclude("Net\NNTP\Client.php"), testInclude("Net\NNTP\Client.php")); ?>  </td> </tr>
		<?php } else { ?>
			<tr> <td> PEAR Net/NNTP </td> <td> <?php echo showResult(testInclude("Net/NNTP/Client.php"), testInclude("Net/NNTP/Client.php")); ?>  </td> </tr>
		<?php } ?>
		<tr> <td> NNTP server </td> <td> <?php showResult(empty($settings['nntp_nzb']['host']) === false, $settings['nntp_nzb']['host'], "No server entered"); ?>  </td> </tr>
	</table>

	<br />

	<table summary="NZB handling">
<?php
	switch ($settings['nzbhandling']['action'] )
	{
		case "save":
		case "runcommand":
		case "push-sabnzbd":
			echo "<tr> <th> NZB local download enabled </th> <th> Value </th> </tr>";
			echo "<tr><td>NZB action: </td><td>" . $settings['nzbhandling']['action'] . "</td></tr>";
			echo "<tr><td>NZB directory: </td><td>" .$settings['nzbhandling']['local_dir'] ."</td></tr>";
			echo "<tr><td>Directory access: </td><td>";
			$TestFileName = $settings['nzbhandling']['local_dir'] ."testFile.txt";
			$TestFileHandle = fopen($TestFileName, 'w') or die("Cannot create file</td></tr>");
			showResult(true);
			echo "</td></tr>";
			fclose($TestFileHandle);
			unlink($TestFileName);
{'fraction_non_alphanumeric': 0.24609037705075315, 'fraction_numerical': 0.009690108414084237, 'mean_word_length': 4.980493402180149, 'pattern_counts': {'":': 6, '<': 439, '<?xml version=': 0, '>': 445, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '570674', 'n_tokens_mistral': 4009, 'n_tokens_neox': 3752, 'n_words': 953}