PHP code example of gfonseca / tunny

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

    

gfonseca / tunny example snippets




return array(
	"system" => array(
		"os" => "Ubuntu",
		"hd" => "1000000GB"
	)
);



y = \Tunny\Config::make([
    "./system_php_array.php",
    "./network_json.json",
    "./system_ini_file.ini",
    "./system_yaml.yml"
]);


$conf = $tunny->get();
print_r($conf);

Array
(
    [system] => Array
        (
            [os] => Fedora
            [hd] => 1000000GB
            [memory] => 99999999
            [cpu] => Intel
            [environment] => Array
                (
                    [iface2] => Gnome
                )

        )

    [network] => Array
        (
            [modem] => U.S. Robotics
        )

)

class SampleDefaults extends \Tunny\Config
{
    protected function defaults(){
        return array(
            "System" => "Ubuntu"
        );
    }
}