Auth::bootstrap()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

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