<commit_before><?php
/**
 * @author <NAME> <<EMAIL>>
 */
require_once __DIR__ . '/../Envtesting.php';

use \envtesting\Check;
use \envtesting\TestSuit;
use \envtesting\Assert;

$suit = new TestSuit('php.ini settings');

// check log_errors
$suit->addTest(
	'error_reporting', function() {
		Assert::true(Check::ini('log_errors', '1'), 'log_errors is OFF');
	}
)->setType('INI');

// check display errors
$suit->addTest(
	'display_errors', function() {
		Assert::true(Check::ini('display_errors', '1'), 'display_errors is OFF');
	}
)->setType('INI');

// check post_max_size

$suit->addTest(
	'post_max_size', function() {
		$size = Check::ini('post_max_size');
		Assert::true($size > 256, 'post_max_size = ' . $size . ' is smaller then 256MB');
	}
)->setType('INI');

echo $suit->run();


echo '--------------------------------------------------------------------------------' . PHP_EOL;

// or KISS way

try {
	Assert::true(Check::ini('post_max_size') > 10000, 'post_max_size is smaller then 10000 MB');<commit_msg>Move comment in example ini.php<commit_after><?php
/**
 * @author <NAME> <<EMAIL>>
 */
require_once __DIR__ . '/../Envtesting.php';

use \envtesting\Check;
use \envtesting\TestSuit;
use \envtesting\Assert;

$suit = new TestSuit('php.ini settings');

// check log_errors
$suit->addTest(
	'error_reporting', function() {
		Assert::true(Check::ini('log_errors', '1'), 'log_errors is OFF');
	}
)->setType('INI');

// check display errors
$suit->addTest(
	'display_errors', function() {
		Assert::true(Check::ini('display_errors', '1'), 'display_errors is OFF');
	}
)->setType('INI');

// check post_max_size

$suit->addTest(
	'post_max_size', function() {
		$size = Check::ini('post_max_size');
		Assert::true($size > 256, 'post_max_size = ' . $size . ' is smaller then 256MB');
	}
)->setType('INI');

echo $suit->run();


echo '--------------------------------------------------------------------------------' . PHP_EOL; // or KISS way

try {
	Assert::true(Check::ini('post_max_size') > 10000, 'post_max_size is smaller then 10000 MB');
{'fraction_non_alphanumeric': 0.2679355783308931, 'fraction_numerical': 0.017569546120058566, 'mean_word_length': 3.261954261954262, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, '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': '1149101', 'n_tokens_mistral': 738, 'n_tokens_neox': 694, 'n_words': 147}