PHP code example of webforge / configuration-tester

1. Go to this page and download the library: Download webforge/configuration-tester library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webforge / configuration-tester example snippets


use Webforge\Setup\ConfigurationTester;

$t = new ConfigurationTester();
$t->INI('mbstring.internal_encoding', 'utf-8');

$t->INI('post_max_size','2M', '>=');
$t->INI('post_max_size',1024, '<');

// if ini_get('post_max_size') is "2M" or 2097152 doesn't matter
$t->INI('post_max_size',2*1024*1024);
$t->INI('post_max_size','2M');

use Webforge\Setup\ConfigurationTester;
use Webforge\Setup\RemoteConfigurationRetriever;

$t = new ConfigurationTester(new RemoteConfigurationRetriever('http://localhost:80/dump-inis.php'));


print json_encode(ini_get_all());

if (count($t->getDefects()) > 0) {
  throw new \RuntimeException('Please check your Config: '.implode("\n", $t->getDefects()));
}

print $t;