podtserkovsky/yii2-user-db-log

Yii2 User DB modifications logger

Installs: 733

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 3

Forks: 0

Type:yii2-extension

1.0.3 2016-07-05 07:44 UTC

This package is not auto-updated.

Last update: 2024-04-17 16:55:09 UTC


README

Yii2 User DB modifications logger. Save modifications your tables.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist podtserkovsky/yii2-user-db-log "*"

or add

"podtserkovsky/yii2-user-db-log": "*"

to the require section of your composer.json file.

Usage

For demo install advanced yii https://github.com/yiisoft/yii2-app-advanced/blob/master/docs/guide/start-installation.md#installing-using-composer Create database and run initial migrations

Apply migrations, run in console:

php yii migrate --migrationPath=@vendor/podtserkovsky/yii2-user-db-log/migrations

Add in your app config:

'modules' => [
        'user-db-log' => [
            'class' => 'podtserkovsky\userdblog\Module',
        ],
    ],

Simply use it in your code by in any ActiveRecord class :

public function behaviors()
{
    return [
        [
            'class' => UserDbLogBehavior::className()
        ],
    ];
}

``

You can then access Log through the following URL:

http://localhost/path/to/index.php?r=user-db-log

or if you have enabled pretty URLs, you may use the following URL:

http://localhost/path/to/index.php/user-db-log