EDbStatePersister implements IStatePersister using DB as storage
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
EDbStatePersister.php
LICENSE
README.md

README.md

#yii-EDbStatePersister

EDbStatePersister implements IStatePersister using DB as storage.

##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 before with CStatePersister.

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