These are chat archives for dektrium/yii2-user

20th
Mar 2014
Sathadev
@skeeran
Mar 20 2014 13:00
hi
i am new to yii2 and trying to learn it... just installed a fresh yii2 installation and found your yii2-user module
but i have problemes getting it run
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
],
    'user' => [
        'identityClass' => 'app\models\User',

    ],

    'user' => 'dektrium\user\components\User',

    'errorHandler' => [
        'errorAction' => 'site/error',
    ],
    'mail' => [
        'class' => 'yii\swiftmailer\Mailer',
    ],
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'yii\log\FileTarget',
                'levels' => ['error', 'warning'],
            ],
        ],
    ],

    'db'=> [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=localhost;dbname=cocumo',
            'username' => 'root',
            'password' => 'om101075',
            'charset' => 'utf8'
    ],


],

//Modules
'modules'=>[
        'user'=>'dektrium\user\Module',
],
this is my configuration and i am getting error when i run this

Warning – yii\base\ErrorException

Illegal string offset 'class'

Dmitry Erofeev
@dmeroff
Mar 20 2014 13:14
There is an issue in documentation, user component should be configured as follows:
    'user' => [
        'class' => 'dektrium\user\components\User',
    ],
Sathadev
@skeeran
Mar 20 2014 13:16
thanks i have done it that way and now getting some other errors

Strict – yii\base\ErrorException

Declaration of dektrium\user\components\User::afterLogin() should be compatible with yii\web\User::afterLogin($identity, $cookieBased)

Dmitry Erofeev
@dmeroff
Mar 20 2014 13:20
seems that you are using outdated version of module, try to change yii2-user version in your composer.json as follows:
"dektrium/yii2-user": "*"
Sathadev
@skeeran
Mar 20 2014 13:22
i am using the version v0.5.0
updated today
and i tryed to update now composer says nothing to update
Dmitry Erofeev
@dmeroff
Mar 20 2014 13:24
well that means that you use outdated yii version
can you show your composer.json?
Sathadev
@skeeran
Mar 20 2014 13:24
sure

{
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Application Template",
"keywords": ["yii", "framework", "basic", "application template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii";,
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "alpha",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "",
"yiisoft/yii2-swiftmailer": "
",
"yiisoft/yii2-bootstrap": "",
"yiisoft/yii2-debug": "
",
"yiisoft/yii2-gii": "",
"yiisoft/yii2-elasticsearch": "
",
"dektrium/yii2-user": "*"
},

"scripts": {
    "post-create-project-cmd": [
        "yii\\composer\\Installer::setPermission"
    ]
},

"extra": {
    "writable": [
        "runtime",
        "web/assets"
    ],
    "executable": [
        "yii"
    ]
}

}

Dmitry Erofeev
@dmeroff
Mar 20 2014 13:25
change minimum-stability to "dev"
and update
Sathadev
@skeeran
Mar 20 2014 13:26
oh okay
its updating few stuffs
now my site is totaly blank :~
Dmitry Erofeev
@dmeroff
Mar 20 2014 13:34
I suggest you to create new application, because there are a lot of bc breaks from alpha yii version to current development version. Create it as described here
Sathadev
@skeeran
Mar 20 2014 13:40
please add a comma at the end of 'class' => 'dektrium\user\components\User' in your installation discription or would it also work without
and module should be also like this : 'modules' => [
'user' => [
'class' => 'dektrium\user\Module',
]
],
okay fresh installation done
now when i run : composer require dektrium/yii2-user "*"
Sathadev
@skeeran
Mar 20 2014 13:46
Problem 1
- dektrium/yii2-user v0.5.0 requires yiisoft/yii2 * -> no matching package found.
- dektrium/yii2-user v0.4.0 requires yiisoft/yii2 * -> no matching package found.
- dektrium/yii2-user v0.3.0 requires yiisoft/yii2 * -> no matching package found.
- dektrium/yii2-user v0.2.0 requires yiisoft/yii2 * -> no matching package found.
- dektrium/yii2-user v0.1.0 requires yiisoft/yii2 * -> no matching package found.
- Installation request for dektrium/yii2-user * -> satisfiable by dektrium/yii2-user[v0.1.0, v0.2.0, v0.3.0, v0.4.0, v0.5.0].
Dmitry Erofeev
@dmeroff
Mar 20 2014 13:55
add "minimum-stability": "dev", to your composer.json
Sathadev
@skeeran
Mar 20 2014 13:57
it is allready dev
Dmitry Erofeev
@dmeroff
Mar 20 2014 14:07
That's strange. I cannot reproduce the issue. I installed yii2 app as described here and then run composer require dektrium/yii2-user "*" inside the application directory. And it works.
Sathadev
@skeeran
Mar 20 2014 14:09
mmm strange i installed also yii like it was discriped there :~
yeah its loading now
Sathadev
@skeeran
Mar 20 2014 14:23
how can i call this login now ... sorry asking this kind newbie questions
Dmitry Erofeev
@dmeroff
Mar 20 2014 14:32
I didn't get you. Did you asked how to go to login page? If so you can access it by this url: index.php?r=user/auth/login
Sathadev
@skeeran
Mar 20 2014 21:19
thanks dmeroff for your help