bedezign / yii2-audit

Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.
https://bedezign.github.io/yii2-audit/
Other
193 stars 112 forks source link

Audit cannot be extended due to usage of Audit::getInstance() #251

Closed cornernote closed 5 years ago

cornernote commented 6 years ago

If you try to do something like this in your config array, all hell breaks loose:

  'modules' => [
        'audit' => [
            //'class' => 'bedezign\yii2\audit\Audit',
            'class' => 'app\components\audit\Audit', 
        ],
    ],

The reason is because Audit::getInstance() uses the calling class's name.

Blizzke commented 5 years ago

getInstance method was overridden to allow exactly this.