PHP code example of mtymek / expressive-config-manager
1. Go to this page and download the library: Download mtymek/expressive-config-manager 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/ */
mtymek / expressive-config-manager example snippets
use Zend\Expressive\ConfigManager\ConfigManager;
use Zend\Expressive\ConfigManager\PhpFileProvider;
$configManager = new ConfigManager(
[
new PhpFileProvider('*.global.php'),
]
);
var_dump($configManager->getMergedConfig());
$configManager = new ConfigManager(
[
function () { return ['foo' => 'bar']; },
new PhpFileProvider('*.global.php'),
]
);
var_dump($configManager->getMergedConfig());
class ApplicationConfig
{
public function __invoke()
{
return ['foo' => 'bar'];
}
}
$configManager = new ConfigManager(
[
ApplicationConfig::class,
new PhpFileProvider('*.global.php'),
]
);
var_dump($configManager->getMergedConfig());