Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Cannot save configuration file
  • Hi!
    I've recently started to use configuration files to save my app settings. I currently have this code. However it doesn't save the configuration file. It always return false status when saving. I've checked and I've got 777 permissions on that file(application.php). What could be the problem?
  • HarroHarro
    Accepted Answer
    I don't have an immediate answer, it works fine here (I get "success" returned). I assume you can read the file correctly?

    BTW there is a typo in your code:

        \Config::set('app.'.$key, $value);

    requires a dot after "app", otherwise it won't store it in the correct position in the config. Or is that replace taking care of that?
  • I've solved the saving problem. But I just now realised, that saving one of my keys this way also deletes all the other keys saved in the same file. Is this a normal?
  • HarroHarro
    Accepted Answer
    Not sure what you exactly mean.

    If you save to an existing config file, you have to make sure you have loaded it's contents first, before making changes.

    Saving a config with just dump whatever is loaded, it does not merge with the data already on disk, it does the merging in memory (which is the only way to delete existing keys).

Howdy, Stranger!

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

In this Discussion