kijho/kijho-chat 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kijho/kijho-chat

Composer 安装命令:

composer require kijho/kijho-chat

包简介

README 文档

README

Bundle for chat

Chat plugin for Symfony 2.8 and 3.x

Preview

Screenshot admin panel: local.loc/app_dev.php/chat/admin alt tag Screenshot client panel: local.loc/app_dev.php/chat/client alt tag

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require kijho/kijho-chat dev-master

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Gos\Bundle\WebSocketBundle\GosWebSocketBundle(), //bundle websockets for chat
            new Gos\Bundle\PubSubRouterBundle\GosPubSubRouterBundle(), //bundle websockets for chat
            new Kijho\ChatBundle\ChatBundle(),
        );

        // ...
    }

    // ...
}

In order to see the view, the bundle comes with a implementation.

Import the routing to your routing.yml

chat:
    resource: "@ChatBundle/Resources/config/routing.yml"
    prefix:   /{_locale}/chat

You must add FrchoCrontaskBundle to the assetic.bundle config

assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    bundles:        [ChatBundle]
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        #closure:

Enabled locale

framework:
    translator:      { fallbacks: ["%locale%"] }

Web Socket Configuration

gos_web_socket:
    shared_config: true
    server:
        port: 5555                #The port the socket server will listen on
        host: 127.0.0.1           #The host ip to bind to
        router:
            resources:
                - "@ChatBundle/Resources/config/routing/chat.yml"

Update the database schema and assets :

symfony 3.0
bin/console doctrine:schema:update --force
bin/console assets:install
bin/console assetic:dump

symfony 2.8
app/console doctrine:schema:update --force
app/console assets:install
app/console assetic:dump

Launching the Server

The Server Side WebSocket installation is now complete. You should be able to run this from the root of your symfony installation.

php app/console gos:websocket:server

If everything is successful, you will see something similar to the following:

Starting Gos WebSocket
Launching Ratchet WS Server on: 127.0.0.1:5555

This means the websocket server is now up and running !

From here, only the websocket server is running ! That doesn't mean you can subscribe, publish, call. Follow next step to do it :)

Ship in production

How run your websocket server in production ?

app/console gos:websocket:server --env=prod or bin/console gos:websocket:server --env=prod

Example with supervisord and other things will come

Fight against memory leak !

So why my memory increase all time ?

In development mode it's normal. (Don't bench memory leaks in this env, never) append your command with --env=prod Are you using fingers_crossed handler with monolog ? If yes, switch to stream. That's fingers_crossed expected behavior. It stores log entries in memory until event of action_level occurs. Dependencies of this bundle can have some troubles :( (But I can't do nothing, and if it's the case, downgrade or freeze impacted dependency) It's your fault :) Dig in you own code. How bench about memory leaks ?

app/console gos:websocket:server --profile --env=prod or bin/console gos:websocket:server --profile --env=prod

And trigger all the things.

Source

https://github.com/GeniusesOfSymfony/WebSocketBundle/blob/master/README.md

kijho/kijho-chat 适用场景与选型建议

kijho/kijho-chat 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 528 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 08 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「Symfony2」 「WebSockets」 「chat」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 kijho/kijho-chat 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kijho/kijho-chat 我们能提供哪些服务?
定制开发 / 二次开发

基于 kijho/kijho-chat 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 528
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 2
  • 开发语言: CSS

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-01