[EXTENSION] MyConfig

This component allows you to manage your website various config items via database or files.

In my case, i created this component because my projects require an area in the admin panel where the clients can set various

config items for the website(Website keywords/description | admin theme | website theme | maintenance theme | contact emails | etc)

and i also have some classes that needs to have their params set dynamically from the admin panel.

Basically, you can save your custom config to database, you can load custom config items from files|database and you can cache them if you like.

More details here:

http://www.yiiframework.com/extension/myconfig/

Looks very good… thanks for sharing

It’s good to know that i can give something back to the community ;)

Regarding the component, i believe it can help a developer a lot, as it helped me.

Nice one. Can be helpful. Thanks for sharing.

Hi, i have installed your component (Yii 1.1.6):




'cfg'=>array(

            'class' =>  'application.components.MyConfig',

            'cacheId'=>null,

            'useCache'=>false,

            'cacheTime'=>0,

            'tableName'=>'userconfig',

            'createTable'=>false,

            'loadDbItems'=>true,

            'serializeValues'=>true,

            'configFile'=>'',

        ),



But getItem not return value:

echo Yii::app()->cfg->getItem(‘test’);

Great extension and very useful !!

When I first try it, it did not create the table as I expected (initialized with createTable => true and tableName => ‘config’).

I had to modify the init() method by changing the order between the first 2 tests :

This is the result and it works fine :




    public function init()

    {

   	// do this first ...

        if($this->getCreateTable())

            $this->createTable();

            

   	// ... and then load items

        if($this->getLoadDbItems())

            $this->loadDbItems();

            

        $this->_initialized=true;

        

        Yii::app()->attachEventHandler('onEndRequest', array($this,'whenRequestEnds'));

    }

Is there something I didn’t do well or did I fix a bug ?

Anyway, it’s really good job, thanks