Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting a value? #23

Closed
Zyles opened this issue Feb 21, 2015 · 1 comment
Closed

Setting a value? #23

Zyles opened this issue Feb 21, 2015 · 1 comment

Comments

@Zyles
Copy link

Zyles commented Feb 21, 2015

I can't seem to update value in a file, what am I doing wrong?

<?php

use Noodlehaus\Config as Config;

$config = Config::load($app->config('base_path') . '/config/config.yaml');
$next_number = $config->get('accounting.next_number');
$new_number = ++$next_number;
$config->set('accounting.next_number', $new_number);

I can return the get value so the file is readable etc. But it wont update the value in the file.

@hassankhan
Copy link
Owner

By design, Config won't overwrite a text file, it will only overwrite that value in-memory.

peter279k pushed a commit to open-source-contributions/config that referenced this issue May 8, 2021
…it/phpunit-7.3.4

Bump phpunit/phpunit from 7.3.3 to 7.3.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants