PHP code example of phpgt / config

1. Go to this page and download the library: Download phpgt/config 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/ */

    

phpgt / config example snippets


// Load config.ini
$config = new Config("/path/to/project");

// Note that the database password is overriden in the environment (from nginx)
// and the host is overridden by the development ini file.
echo $config->get("database.host");		// localhost
echo $config->get("database.port");		// 6612
echo $config->get("database.password");		// super-secret-passw0rd

location ~ \.php$ {
	fastcgi_pass	unix:/var/run/php/php7.1-fpm.sock;
	fastcgi_param	database_password	super-secret-passw0rd;
	
ini
[database]
host = localhost