PHP code example of danack / configurator

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

    

danack / configurator example snippets




$config = <<< END

server {

    access_log  ${'nginx.log.directory'}/project.access.log requestTime;    
    error_log  ${'nginx.log.directory'}/project.error.log;
    root ${'project.root.directory'}/public;
}

END;

return $config;




$centos = [
    'nginx.log.directory' => '/var/log/nginx', 
    'project.root.directory' => '/home/project',
];

$windows = [
    'nginx.log.directory' => 'c:/nginx', 
    'project.root.directory' => 'c:/documents/project',
];

$john = [
    'project.root.directory' => '/home/workdir/project',
]




use ExampleApp\AppConfig;

$env = [
    AppConfig::CACHING_SETTING,
    AppConfig::SCRIPT_PACKING,
    AppConfig::FILE_STORAGE
];

return $env;

$dev = [
    AppConfig::SCRIPT_PACKING => true,
    AppConfig::CACHING_SETTING => 'caching.disable',
];

$live = [
    AppConfig::SCRIPT_PACKING => true,
    AppConfig::CACHING_SETTING => 'caching.time'
]; 

// Anyone doing UX testing needs to have the scripts packed together
// to avoid slow UI responses
$uxtesting = [AppConfig::SCRIPT_PACKING => true];



function getAppEnv() {
    static $env = [
        'caching.setting' => 'caching.disable',
        'script.packing' => 'true',
    ];

    return $env;
}