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 111 forks source link

error on migration after installing yii2 audit #133

Closed zainalawaludin closed 8 years ago

zainalawaludin commented 8 years ago

hi i has install yii2-audit after install then i want to migration database but found error like this

Exception 'yii\base\InvalidConfigException' with message 'The configuration for the "controllerMap" component must contain a "class" element.'. thanks

cornernote commented 8 years ago

controllerMap should not be inside the components array.

If you are unsure please paste your config file (after removing any sensitive information like passwords).

zainalawaludin commented 8 years ago

hi cornernote below this my config :

<?php

$params = require(__DIR__ . '/params.php');

$config = [
    'id' => 'basic',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'components' => [
        'authManager' => [
            'class' => 'yii\rbac\DbManager'
        ],
        'urlManager' => [
            'class'=>'yii\web\UrlManager',
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                ['class' => 'yii\rest\UrlRule',
                    'controller' => 'site',
                    'tokens' => [
                        '{message}' => '<message:\\d+>'
                    ],
                    'extraPatterns' => [
                        'GET say/{message}' => 'say'
                    ],

                    'pluralize' => false,
                ],
            ]
        ],

        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'user' => [
            'identityClass' => 'app\models\User',
            'enableAutoLogin' => true,
            'loginUrl' => ['site/login'],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],

        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'db' => require(__DIR__ . '/db.php'),
    ],
    'params' => $params,
    'modules' =>[
        'gridview' => [
            'class' => '\kartik\grid\Module'
        ],
        'admin' => [
            'class' => 'mdm\admin\Module',
        ],
        'audit' => 'bedezign\yii2\audit\Audit',
    ],

];

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    //$config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
    ];

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
    ];
}

return $config;
Blizzke commented 8 years ago

Hmm, we only use the controllerMap feature in 1 place, the bootstrap functionality, and there is an explicit check that the current $app instance is a console application (which normally has that feature as it's part of a Module). What version of Yii2 are you running?

zainalawaludin commented 8 years ago

hi blizzke i use YII2 version 2.0.5 basic

zainalawaludin commented 8 years ago

FYI i follow guide installation on this link https://bedezign.github.io/yii2-audit/docs/installation/ and in step migration found error

Blizzke commented 8 years ago

With the information we have so far it's impossible for us to determine what the problem is. Your config has no obvious issues. If you are able to get the actual exception stack trace and more info on from your logs, that might help us.

zainalawaludin commented 8 years ago

oke problem solved, my application is broken