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

Add config issue #10

Open
KarelWintersky opened this issue Feb 21, 2023 · 1 comment
Open

Add config issue #10

KarelWintersky opened this issue Feb 21, 2023 · 1 comment

Comments

@KarelWintersky
Copy link
Collaborator

config('LOGGING.PRINT_TO_BROWSER', true);

config('LOGGING', [
    'APP_INSTANCE'          =>  $app_instance,
    'SEARCH_REQUESTS'       =>  getenv('LOGGING.SEARCH_REQUESTS'),
    'REDIS.ALL'             =>  getenv('LOGGING.REDIS.ALL'),
    'REDIS.UPDATE'          =>  getenv('LOGGING.REDIS.UPDATE'),
    'FRONTEND.SEND_ARTICLE' =>  getenv('LOGGING.FRONTEND.SEND_ARTICLE'),
    'FRONTEND.RENDER'       =>  getenv('LOGGING.FRONTEND.RENDER'),
]);

var_dump( config('LOGGING.PRINT_TO_BROWSER') );

// NULL

То есть addConfig не режет имя ключа по точкам. Вообще это проблема еще и пакета https://github.com/adbario/php-dot-notation/ ...

@KarelWintersky
Copy link
Collaborator Author

KarelWintersky commented Feb 21, 2023

public function setConfig($key, $value = null)
    {
        if (is_array($value)) {
            $this->config->merge($key, $value);
        } else {
            $this->config->set($key, $value);
        }
    }

looks like it will fix issue...

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

1 participant