Completed
Push — master ( 6ff6d1...70482c )
by Alexey
02:17
created

Auth::init()   D

Complexity

Conditions 9
Paths 28

Size

Total Lines 28
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 28
rs 4.909
cc 9
eloc 17
nc 28
nop 0
1
<?php
2
3
namespace yiicod\auth;
4
5
use Yii;
6
use yii\base\BootstrapInterface;
7
use yii\base\Component;
8
use yii\console\Application;
9
use yii\helpers\ArrayHelper;
10
11
class Auth extends Component implements BootstrapInterface
12
{
13
14
    /**
15
     * @var array Models settings
16
     */
17
    public $modelMap = [];
18
19
    public function bootstrap($qpp)
20
    {
21
        //Merge main extension config with local extension config
22
        $config = include(dirname(__FILE__) . '/config/main.php');
23
        foreach ($config as $key => $value) {
24
            if (is_array($value)) {
25
                $this->{$key} = ArrayHelper::merge($value, $this->{$key});
26
            } elseif (null === $this->{$key}) {
27
                $this->{$key} = $value;
28
            }
29
        }
30
31
        Yii::setAlias('@yiicod', realpath(dirname(__FILE__) . '/..'));
32
        // Namespace for migration
33
        Yii::setAlias('@yiicod_auth_migrations', realpath(dirname(__FILE__) . '/migrations'));
34
    }
35
36
}
37