2017 © Pedro Peláez
 

library setting

The setting component of ecom

image

ecom/setting

The setting component of ecom

  • Friday, January 3, 2014
  • by bixuehujin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 115 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ecom-setting

The setting component of ecom., (*1)

Features

  • Multiple storage backend support, such as RDMBS database and Redis.
  • Custom storage backend support, by implement the StorageInterface interface.
  • ArrayAccess support, you can access settings just like arrays.

Installation

The recommended way to install ecom-setting is via composer., (*2)

  1. Add a single line to composer.json:, (*3)

    "require": {
        ...
        "ecom/setting": "dev-master"
        ...
    }
    
  2. Run composer to update denpendencies:, (*4)

    $ cd /path/to/project
    $ php composer.phar update
    

Usage

  1. Import the table schema located in data directory, (*5)

  2. Set up settings as application component, (*6)

    //...
    'aliases' => array(
      'ecom' => 'application.vendors.ecom',
    ),
    'components' => array(
      //...
      'setting' => array(
          'class' => 'ecom\settings\Setting',
      ),
      //...
    ),
    //...
    
  3. Store settings via setting component., (*7)

    $settings = Yii::app()->getComponent('setting');
    $settings->set('foo', 'value of foo');
    $bar = $settings->get('bar', 'default value');
    $settings->delete('foo');
    
    //you can also using settings like arrays
    $settings['foo'] = 'value of foo';
    $bar = $settings['bar'];
    unset($settings['foo']);
    

Authors

Licence

  • MIT

The Versions

03/01 2014

dev-master

9999999-dev https://github.com/bixuehujin/ecom-setting

The setting component of ecom

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

component yii setting extention