New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

crcms/file-config

file config put and read
1,076 2
Install
composer require crcms/file-config
Latest Version:0.0.7
PHP:>=7.0
Laravel:5
License:MIT
Last Updated:Apr 26, 2018
Links: GitHub  ·  Packagist
Maintainer: hiword

file-config

Sets the storage format of the configuration file

Example

update file_config.php

'files'=>[
    /tmp/crcms,
    // Set up other parsing drivers
    /tmp/crcms => \CrCms\FileConfig\Drives\SerializeConfig::class,
    
],

'default_drive'=>\CrCms\FileConfig\Drives\DefaultConfig::class,

put

file_config([
    crcms.a=>'a',
    crcms.b=>'b'
])

//or

file_config()->put('crcms.a',['k'=>'k','s'=>'s'])

get

file_config('crcms.a')

all

file_config('crcms')

destroy

file_config()->destroy('crcms.a')

0.0.2 above the new load method

Example test.php
key1=>value1
key2=>value2

//get all
file_config()->load('/path/test.conf')->all('test')

0.0.3 Add multiple dot depth support

file_config()->load('/path/test.conf')->get('test.depth1.depth2.0')

0.0.4 Overwrite all configurations

file_config(['crcms'=>[1,2,3]])

//or

file_config()->put('crcms',['key'=>[1,'value']])

Install

You can install the package via composer:

composer require crcms/file-config

Laravel

Modify config / app.php

'providers' => [
    CrCms\FileConfig\FileConfigServiceProvider::class,
]


'aliases' => [
    'FileConfig' => \CrCms\FileConfig\Facades\FileConfig::class
],

If you'd like to make configuration changes in the configuration file you can pubish it with the following Aritsan command:

php artisan vendor:publish --provider="CrCms\FileConfig\FileConfigServiceProvider"

Laravel Testing

phpunit ./tests/Config

License

MIT

Related Packages

inoplate/config

Inoplate configuration repository

14 0
valorin/random

Random is a simple helper package designed to make it easy to generate a range o...

413,065 233
php
cline/variable-keys

Laravel Blueprint macros for variable primary key and morph types

22,912 0
php
cline/struct

Lean, attribute-driven Laravel data objects with explicit validation and Eloquen...

17,788 0
php
cline/toggl

Advanced feature flag management with strategies, time bombs, and groups

12,171 0
php

Version History

Version Released PHP Laravel License
0.0.7 >=7.0 ^5.3 MIT
0.0.6 >=7.0 ^5.3 MIT
0.0.5 >=7.0 ^5.3 MIT
0.0.4 >=7.0 ^5.3 MIT
0.0.3 >=7.0 ^5.3 MIT