Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Config::save('any-config', 'any_config') at config/{Fuel::$env}/any-config.php
  • Hi,

    My environment Fuel::$env is "production".

    There are the following files:
    ・fuel/app/config/any.php
    ・fuel/app/config/production/any.php

    When loading, 
    Config::get('any.param') is app/config/production/any.php param override the app/config/any.php .

    When writing, 
    Execute Config::save('any','any'), Result will be stored in the app/config/any.php

    Is not used Fuel::$env at save function.

    I made ​​a action with the following:

    But, This action is not the real intention.
    Have a good idea by the other?
    (Want you to fix Fuel/Core/Config_File, If possible ...)

    Sorry for my poor english.

  • This is correct behavior.

    When loading a config file, you can have up to 8 files being merged (module, app, package, core, both with a global and enviroment specific version).

    When saving, Fuel has no way of knowing from which of they 8 a particular key came from, it always saves to app/config, unless you specify a fully qualified path.

    Your question is: if there is an app/config/environment file, save it to that one instead of the global one? If so, please create a feature request for it at https://github.com/fuel/core/issues with this use-case.
  • Thanks! 

    I understand.
    I did not need to be registered in the issue.

    I made ​​a action with the following:

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion