2amigos / yiinitializr

Library that will help boost your application installation with ease and also to run Yii applications from its bootstrap files on a much cleaner way that the framework currently proposes.
Other
44 stars 17 forks source link

other config file (backend env local or frontend env local and etc) does not include #1

Closed farmani closed 11 years ago

farmani commented 11 years ago

so config method in initializer should be change:

public static function config($configName = 'main', $mergeWith = null)
{
    $files = array($configName);
    $directory = Config::value('yiinitializr.app.directories.config.' . $configName);
    if (null === $directory)
        throw new \Exception("Unable to find 'yiinitializr.app.directories.config.'{$configName} on the settings.");

    if (null !== $mergeWith)
    {
        if (is_array($mergeWith))
        {
            foreach($mergeWith as $file)
                $files[] = $file;
        }
        else
            $files[] = $mergeWith;
    }

    // do we have any other configuration files to merge with?
    $mergedSettingFiles = Config::value('yiinitializr.app.files.config.' . $configName);
    if (null !== $mergedSettingFiles)
    {
        foreach($mergedSettingFiles as $file)
            $files[] = $file;
    }

    $config = self::build($directory, $files);

    $params = isset($config['params'])
        ? $config['params']
        : array();

    self::setOptions($params);

    return $config;
}

I'm going to use Yiinitializr in an entrprise project hope to less bug :)
tonydspaniard commented 11 years ago

:+1: good one @farmani

I am using the advanced boilerplate, no issues yet... nevertheless, thats why we have it on Open Source... we need to make it better :)

Edit:

We did it already on previous versions: https://github.com/2amigos/yiinitializr/blob/master/Helpers/Initializer.php#L84

tonydspaniard commented 11 years ago

Thank you very much... it was a simple but very important bug