2017 © Pedro Peláez
 

yii2-extension yii2-project-configuration

This extension helps you to easily store and retrieve settings for your project.

image

lav45/yii2-project-configuration

This extension helps you to easily store and retrieve settings for your project.

  • Thursday, November 2, 2017
  • by LAV45
  • Repository
  • 1 Watchers
  • 1 Stars
  • 217 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

yii2-project-configuration

Latest Stable Version License Total Downloads, (*1)

This extension helps you to easily store and retrieve settings for your project., (*2)

Installation

The preferred way to install this extension through composer., (*3)

You can set the console, (*4)

~$ composer require "lav45/yii2-project-configuration" --prefer-dist

or add, (*5)

"require": {
    "lav45/yii2-project-configuration": "1.0.*"
}

in require section in composer.json file., (*6)

Using

// Yii::setAlias('@app_config_path', __DIR__ . '/settings');

$db_name = config('db_name', 'site-db-name');
$db_host = config('db_host', 'localhost');

return [
    'components' => [
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => "mysql:host={$db_host};dbname={$db_name}",
            'username' => config('db_username', 'root'),
            'password' => config('db_password', '****'),
            'enableSchemaCache' => true,
            'charset' => 'utf8',
        ],
    ]
];

Management

Control is made through a console controller Will add it to the console application's configuration file, (*7)

return [
    'controllerMap' => [
        'config' => 'lav45\projectConfiguration\console\controllers\ConfigController'
    ]
];

Use console controller

# Set value by key
~$ yii config db_name site-db

# Display all keys
~$ yii config
~>    db_name: site-db

# Show value by key
~$ yii config db_name
~> site-db

# Delete key
~$ yii config/delete db_name

You can configure the component using Yii::setAlias() before using the config(), (*8)

Key Default value Description
@app_config_key 'app-config' The key which will be stored settings
@app_config_path '/storage' Path where will be stored the file with the settings

License

yii2-project-configuration it is available under a BSD 3-Clause License. Detailed information can be found in the LICENSE.md., (*9)

The Versions

02/11 2017

dev-master

9999999-dev https://github.com/lav45/yii2-project-configuration

This extension helps you to easily store and retrieve settings for your project.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Loban

settings extension config yii2

08/10 2017

1.0.1

1.0.1.0 https://github.com/lav45/yii2-project-configuration

This extension helps you to easily store and retrieve settings for your project.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Loban

settings extension config yii2

23/08 2017

1.0.0

1.0.0.0 https://github.com/lav45/yii2-project-configuration

This extension helps you to easily store and retrieve settings for your project.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Loban

settings extension config yii2