Created
October 10, 2016 23:26
-
-
Save frugan-dev/05e2f3c58e5f5cbd8ee49df5dcb8f443 to your computer and use it in GitHub Desktop.
Zend Config Factory with preserveNumericKeys and operator params
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "root/zend-config-operator", | |
"repositories": [ | |
{ | |
"type": "vcs", | |
"url": "https://github.com/ewake/zend-config" | |
} | |
], | |
"require": { | |
"zendframework/zend-config": "dev-master", | |
"zendframework/zend-servicemanager": "^3.1", | |
"zendframework/zend-json": "^3.0", | |
"zendframework/zend-stdlib": "^3.1", | |
"zendframework/zend-diactoros": "^1.3", | |
"raveren/kint": "^1.0" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__.'/vendor/autoload.php'; | |
$regex = '{'; | |
$regex .= __DIR__.'/config/{'; | |
$regex .= '*,'.getenv('SERVER_ADDR').'/*,'.getenv('HTTP_HOST').'/*'; | |
$regex .= '}}.{ini,json,xml,yaml,properties,php}'; | |
$files = glob($regex, GLOB_BRACE); | |
//$config = Zend\Config\Factory::fromFiles($files); | |
$config = Zend\Config\Factory::fromFiles($files, false, false, true, 'array_merge'); // union, array_merge, array_merge_recursive, null | |
s($config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment