edbstatepersister

EDbStatePersister implements IStatePersister using DB as storage
1 follower

EDbStatePersister implements IStatePersister using DB as storage

You can always get an actual version at https://github.com/pavel-voronin/yii-EDbStatePersister/.

Requirements

  • Yii Framework 1.1.6+

Installing

Get yii-EDbStatePersister from github:

cd protected/extensions
git clone git://github.com/pavel-voronin/yii-EDbStatePersister.git

Add to protected/config/main.php the following:

'components' => array
(
  'statePersister' => array
  (
    'class' => 'ext.yii-EDbStatePersister.EDbStatePersister',
    'dbConnection' => 'db2', // defaults to 'db'. Db connection component must inherit CDbConnection class.
    'tableName' => 'myapp_states' // defaults to 'states'
  ),
),

Usage

EDbStatePersister fully implements IStatePersister, so you can use load() and save($state) methods in the same way as you did with CStatePersister before.

In addition, EDbStatePersister provides clear() method to remove state record from DB at all.

Be the first person to leave a comment

Please to leave your comment.

Create extension