PHP code example of corneltek / configkit
1. Go to this page and download the library: Download corneltek/configkit 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/ */
corneltek / configkit example snippets
return array (
'ApplicationName' => 'Phifty',
'ApplicationID' => 'phifty',
'ApplicationUUID' => '9fc933c0-70f9-11e1-9095-3c07541dfc0c',
'Domain' => 'phifty.dev',
$config = ConfigCompiler::load('tests/ConfigKit/data/framework.yml');
print_r( $config );
ConfigCompiler::$statCheck = false;
$config = ConfigCompiler::load('tests/ConfigKit/data/framework.yml');
$compiledFile = ConfigCompiler::compile('config/framework.yml');
$compiledFile = ConfigCompiler::compile('config/framework.yml', 'config/framework.php');
$compiledFile = ConfigCompiler::override_compile('config/framework.yml', array(
'something_should_not_be_in_config_file' => 123123123,
'something_should_not_be_in_git' => 123123123,
'something_generated_in_the_runtime' => random(),
));
if ( ConfigCompiler::test('config/framework.yml','config/framework.php')) ) {
ConfigCompiler::compile(....);
} else {
// already up to date.
}
$loader = new ConfigLoader;
$loader->load( 'framework', 'config/framework.yml' );
$loader->load( 'database', 'config/database.yml' );
$paths = $loader->get('framework','web.paths');
$templates = $loader->get('framework','web.templates');
foreach( $paths as $path ) {
echo $path, "\n";
}
$loader->writeStashes('all.php');
$loader->loadStashes('all.php');
$loader = new ConfigKit\ConfigLoader;
$loader->load('database','tests/data/database.yml');
$loader->load('framework','tests/data/framework.yml');
$appClass = $loader->generateAppClass('MyApp\\AppConfigLoader');
$path = $appClass->generatePsr4ClassUnder('tests');