PHP code example of hurtcode / configure-yaml

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

    

hurtcode / configure-yaml example snippets



$config = new \Hurtcode\Config\Yaml\Config('config/diractory/path', 'entpryPointFile');
$compiler = new \Hurtcode\Config\Yaml\Compiler(
    new \Hurtcode\Config\Yaml\Tag\AbstractTagProcessorFactory(
        new \Hurtcode\Config\Yaml\Tag\TagProcessorMap()
    )
);

$applicationConfigs = (new \Hurtcode\Config\Configurator($config, $compiler))->run();

[
    'id' => 'accounting',
    'basePath' => '/var/httpd/sites/example',
    'components' => [
        'db' => [
            'class' => 'App/Connection/DbClass',
            'connection' => [
                'port' => '5543',
                'host' => 'localhost'
            ],
        ],
        'log' => [
            'class' => 'App/Logger',
            'targets' => [
                'DEBUG',
                'TEST',
                'INFO'
            ]
        ],
        'security' => [
            'class' => 'App/Common/Security',
            'keyDir' => '/var/httpd/sites/example/kyes/public'
        ]          
    ]   
];