ice / framework

Source code of Ice framework
https://www.iceframework.org
BSD 3-Clause "New" or "Revised" License
341 stars 45 forks source link

Load config from php file #167

Closed Yahasana closed 6 years ago

mruz commented 6 years ago

What would you say to add a new adapter config/php similar to https://github.com/ice/framework/blob/dev/ice/config/json.zep?

public function __construct(var data = null)
{
    parent::__construct(require data);
}
Yahasana commented 6 years ago

yep, ini style config is hard to read for cascade array.

<?php
return [
    'group1' => [
        'a' => [
            'option' => []
        ]
    ]
];

I'm prefer $cfg = new \Ice\Config($file) to $cfg = new \Ice\Config\php($file)

Yahasana commented 6 years ago

@mruz Inspired by your great idea, I removed the load helper but just let the config load data from php file directly. $cfg = \Ice\Config($file)