2017 © Pedro Peláez
 

yii2-extension yii2-log

Package

image

pvsaintpe/yii2-log

Package

  • Friday, July 27, 2018
  • by pvsaintpe
  • Repository
  • 1 Watchers
  • 0 Stars
  • 117 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 33 Versions
  • 368 % Grown

The README.md

Installation, (*1)

The preferred way to install this extension is through composer., (*2)

Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json. Either run, (*3)

$ php composer.phar require pvsaintpe/yii2-log "5.*"

or add, (*4)

"pvsaintpe/yii2-log": "5.*"

to the require section of your composer.json file., (*5)

Additional information, (*6)

All base models and query must be inherited from:, (*7)

ActiveRecord extends \pvsaintpe\log\components\ActiveRecord ActiveQuery extends \pvsaintpe\log\components\ActiveQuery, (*8)

To track changes, add to your model:, (*9)

/**
 * @return bool
 */
public static function logEnabled()
{
    return true;
}

Build project, (*10)

Every time when you change the database schema to be logged, run the command:, (*11)

#!/usr/bin/env bash
php ./yii changelog/generate
php ./yii changelog/migrate --interactive=0

Customization, (*12)

  1. To access the visual part, for example, to view revisions and change history of your data, add to the config:
// backend/configs/main.php
return [
    'modules' => [
        'changelog' => [
            'class' => 'pvsaintpe\log\Module',
        ],
    ]
];
  1. To fine-tune the logging system, use the configurator. For a complete list of available options, see pvsaintpe\log\components\Configs:
// common/configs/params.php
return [
    'changelog.configs' => [
        'db' => 'dbLog', // DB Storage for Log-tables
        'storageDb' => 'db', // DB Storage for Data-tables
        'adminTable' => 'admin', // Table Name for Admin's
        'tablePrefix' => '_log',
        'adminColumn => 'updated_by',
    ],
];

Usage, (*13)

To activate all features of the component, use pvsaintpe\log\traits\SearchTrait in your Search-models. It is recommended to keep the log data in a separate database, although you are not limited in this., (*14)

The Versions

09/04 2018

v1.0.4

1.0.4.0

Package

  Sources   Download

MIT

The Requires

 

by Pavel Veselov

yii2 gii code generator

09/04 2018

v1.0.3

1.0.3.0

Package

  Sources   Download

MIT

The Requires

 

by Pavel Veselov

yii2 gii code generator

09/04 2018

v1.0.7

1.0.7.0

Package

  Sources   Download

MIT

The Requires

 

by Pavel Veselov

yii2 gii code generator

09/04 2018

v1.0.2

1.0.2.0

Yii 2 Log Extension

  Sources   Download

MIT

The Requires

 

by Pavel Veselov

yii2 gii code generator

09/04 2018

v1.0.0

1.0.0.0

Yii 2 Log Extension

  Sources   Download

MIT

The Requires

 

by Pavel Veselov

yii2 gii code generator