|Last Updated||Ratings||Unique User Downloads||Download Rankings|
|2018-06-05 (11 months ago)||65%||Total: 1,196 This week: 4||All time: 3,115 This week: 102|
|mysql-websocket-chat 1.3||MIT/X Consortium ...||5||HTTP, PHP 5, Databases, Chat|
This package can Websocket chat that stores messages in MySQL using PDO.
php mysql websocket chat
What is the best PHP chat room class?
Welcome to this hackaton project i created for user hrushi on phpclasses.org. The idea was to create a websocket chat application that could be logging to a database. So here is what you need to get this up and running. *Please note* the minimum required php version is 5.6 this is not because it wanted this but its because of the dependencies this project has.
First thing you is installing composer on to your system. You can get composer here. Don't worry it might seem intimidating but its really not.
If you download this package in a zip file from phpclasses.org you will have to extract the zip package to a location of your liking. Then CD into that directory and execute the following command on your prompt.
In this example i am using a mac so my prompt will display different then you if you are on windows. Don't worry about that to much and execute the following command.
$ cd chat $ composer install
On the other hand with composer installed you could use a more confidant method by installing the project via the composer create-project option. This will automatically download and install the project into the chat directory.
$ composer create-project johnnymast/mysql_websocket_chat chat
This will now download the whole project (and its dependencies) for you so you can run it.
This server can run with or without a database. By default i have disabled the use of a database server but you can enable it by switching the ENABLE_DATABASE to true in the includes/config.php file. *Please note* if you enable the database make sure you update the credentials as well (see other defines).
Also if you enable the database make sure you have imported database.sql into your database.
CD in to the chat directory and fire up the server.
$ cd chat $ php ./server.php
When you see no output and the command seems to hang that's when you know its running.
In the chat directory you will find index.php. This file will be the client for your chat application. Make sure you set any webserver its document root to this location.
Now open up 2 chat tabs and point them to localhost (or maybe a virtual host you configured) and chat away with your self.
mysql_websocket_chat is created and maintained by Johnny Mast. For feature requests or suggestions you could consider sending me an e-mail.
Oh and if you've come down this far, you might as well follow me on twitter.
Copyright (c) 2018 Johnny Mast
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|css (1 file)|
|includes (1 file, 1 directory)|
|js (3 files)|
|Install with Composer|
|Version Control||Unique User Downloads||Download Rankings|