PHP code example of gummmibear / ze-config-manager

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

    

gummmibear / ze-config-manager example snippets



//config/config.php


\ConfigManager;
use Zend\Expressive\Config\ConfigFileProviderFactory;
use Zend\Expressive\Config\ConfigFileProviderManager;

$configFileProviderFactory = new ConfigFileProviderFactory(__DIR__ . '/autoload/');
$configFileProviderManager = new ConfigFileProviderManager($configFileProviderFactory);

$routingFileProviderFactory = new ConfigFileProviderFactory(__DIR__ . '/routing/');
$routingFileProviderManager = new ConfigFileProviderManager($routingFileProviderFactory);

$configManager = new ConfigManager(__DIR__);
$configManager->setCacheFile('/cache/config_cache.php');
$configManager->registerProviders($configFileProviderManager->createDefaultProviders());
$configManager->registerProviders($routingFileProviderManager->createDefaultProviders());
$config = $configManager->getConfig();

return new ArrayObject($config, ArrayObject::ARRAY_AS_PROPS);