PHP code example of mireiawen / configuration

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

    

mireiawen / configuration example snippets


$configuration = new Mireiawen\Configuration\JSON('config.json');
$hostname = $configuration->GetString('hostname');
$port = $configuration->GetInt('port');

Configuration::__construct(string $filename)

Configuration::__construct(string $filename)

Configuration::Has(string $key) : bool

Configuration::Get(string $key, mixed $default) : mixed

Configuration::GetString(string $key, string|null $default) : string

Configuration::GetInt(string $key, int|null $default) : int

Configuration::GetFloat(string $key, float|null $default) : float

Configuration::GetBool(string $key, bool|null $default) : bool

Configuration::GetAsString(string $key, string|null $default) : string

Configuration::GetAsInt(string $key, int|null $default) : int

Configuration::GetAsFloat(string $key, float|null $default) : float

Configuration::GetAsBool(string key, bool|null default) : bool