PHP code example of nuglif / nacl

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

    

nuglif / nacl example snippets


> 
> $parser = Nuglif\Nacl\Nacl::createParser();
> $parser->setVariable('TMP_DIR', sys_get_temp_dir());
> $config = $parser->parseFile('application.conf');
> 



$config = Nuglif\Nacl\Nacl::parseFile('application.conf');



$parser = Nuglif\Nacl\Nacl::createParser();
$config = $parser->parseFile('application.conf');



interface MacroInterface
{
    public function getName(): string;

    public function execute(mixed $parameter, array $options = []): mixed;
}



Nuglif\Nacl\Nacl::registerMacro(new MyMacro);
$config = Nuglif\Nacl\Nacl::parseFile('application.conf');



$parser = Nuglif\Nacl\Nacl::createParser();
$parser->registerMacro(new MyMacro);
$config = $parser->parseFile('application.conf');

nacl
file_max_size 7MB; # 7 * 1024^2 (bytes)
file_ttl 9min;     # 9 * 60 (seconds)
nacl
file_max_size 7340032; # 7 * 1024^2 (bytes)
file_ttl 540;          # 9 * 60 (seconds)

email {
	template .file "welcome.tpl";
}