PHP Classes

PHP Web Socket Chat: Chat system using Websockets or AJAX requests

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 274 All time: 7,679 This week: 57Up
Version License PHP version Categories
webchat 1.0.0MIT/X Consortium ...5PHP 5, Chat
Description 

Author

This package implements a chat system using Websockets or AJAX requests.

It uses Ratchet PHP library create a Websocket application that establishes the communication between the users of a chat application.

The package can manage chat users, chat messages and logged messages.

Picture of Felix Ivan Romero Rodríguez
  Performance   Level  

 

Example

<?php
use Ratchet\Server\IoServer;
use
Ratchet\Http\HttpServer;
use
Ratchet\WebSocket\WsServer;
use
MyApp\Chat;
use
Doctrine\MongoDB\Connection;
use
Doctrine\ODM\MongoDB\Configuration;
use
Doctrine\ODM\MongoDB\DocumentManager;
use
Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;

$loader = require dirname(__DIR__) . '/vendor/autoload.php';
$connection = new Connection();
$config = new Configuration();
$config->setProxyDir(__DIR__ . '/Proxies');
$config->setProxyNamespace('Proxies');
$config->setHydratorDir(__DIR__ . '/Hydrators');
$config->setHydratorNamespace('Hydrators');
$config->setDefaultDB('chat_room');
$config->setMetadataDriverImpl(AnnotationDriver::create(__DIR__ . '/src/MyApp/Persistence'));
AnnotationDriver::registerAnnotationClasses();
$dm = DocumentManager::create($connection, $config);
$server = IoServer::factory(
    new
HttpServer(
        new
WsServer(
            new
Chat($dm)
        )
    ),
   
1919
);
$server->run();


Details

Chanic WebChat

Simple Chat using Ratchet


  Files folder image Files (614)  
File Role Description
Files folder imageapp (2 files)
Files folder imagebin (1 file, 1 directory)
Files folder imagedoc (1 file)
Files folder imagesrc (1 directory)
Files folder imageweb (3 files, 3 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file Readme.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:274
This week:0
All time:7,679
This week:57Up