Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using chat without MongDB server #22

Open
koredalin opened this issue Apr 25, 2017 · 0 comments
Open

Using chat without MongDB server #22

koredalin opened this issue Apr 25, 2017 · 0 comments

Comments

@koredalin
Copy link

koredalin commented Apr 25, 2017

I use XAMPP. php v5.6.15. MySql server.
I have istalled:
"dektrium/yii2-user": "^0.9.12",
"joni-jones/yii2-wschat": "^1.0",
"yiisoft/yii2-mongodb": "^2.1"
I have installed php mongodb extension too. The console server started with no errors. However - there is a set of JS errors.
The server is started: C:>netstat -na | find "8080"
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING
My ServerController:
class ServerController extends \yii\console\Controller { public function actionRun() { $manager = \Yii::configure(new ChatManager(), [ 'userClassName' => '\yii\db\ActiveRecord' //allow to get users from MySQL or PostgreSQL // 'userClassName' => '\dektrium\user\models\User' //allow to get users from MySQL or PostgreSQL ]); $server = IoServer::factory(new HttpServer(new WsServer(new Chat($manager))), 8080); $server->run(); } }
console.php
'mongodb' => [ 'class' => '\yii\mongodb\Connection', 'dsn' => 'mongodb://wschat:wschat@localhost:27017/wschat' ], 'db' => $db, 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'flushInterval' => 1, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error', 'warning', 'info'], 'logVars' => [], 'exportInterval' => 1 ], ], ],

My view:
echo ChatWidget::widget([ 'auth' => true, 'user_id' => \Yii::$app->user->getIdentity()->id ]);

There are many errors in the JS console:
GET http://localhost/wschat/web/assets/733e3305/underscore/underscore-min.js - 404 Exception
backbone.js:382 Uncaught TypeError: Cannot read property 'extend' of undefined
at backbone.js:382
at backbone.js:31
at backbone.js:34
These are only in the beginning.

What can I do next?
Thank you for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant