Posts

Showing posts with the label mysql

Realtime Chat Application with CakePHP and Socket.IO #2

Image
Before , We begin we need the main layout for the application ,in my case i  make ctp file (cakephp file ) I include in the css and js files for   Material Design for Bootstrap  just to have a modern look for the application <?php echo $this -> fetch( ' content ' ); ? > this echo the view for other pages / controllers's actions we need also to another layout file  to use it in chat PS : the layout  files are in this directory app/view/layout , it's specific for cakephp 2

Realtime Chat Application with CakePHP and Socket.IO #1

Image
In this blog we will build a Realtime Chat Application with CakePHP and Socket.IO Your are free to use another framework, the idea is just learning the basics and a few (Socket.IO) tips Database :  To store our data for this application we need 4 tables :  users :         contains user's informations such as username and password hash ,email ...  messages : contains messages between users, it also store the information of sender and destination  user companies : or teams table ,in order to organise groups i add this table to give the user the freedom  of organizing his contact it stores the company name with his owner .   companies_users : it contains the users and their respective  companies here the SQL file fo database structure     file in the next tutorial we'r gone started building the frontend using cakephp  

Creating my First PHP Framework : Day 2

Image
First things first , i'needed a file (init.php) witch requires all other components of the framework , also all the static variables such as APP and CSS directories so i called it init.php                                                       <?php define ( ' ROOT ' , dirname ( __DIR__ )); define ( ' APP ' , ROOT . "/ app /" ); define ( ' WEBROOT ' , " http:// " . $_SERVER [ ' HTTP_HOST ' ] . dirname ( $_SERVER [ ' PHP_SELF ' ]) . " / " ); define ( ' CSS ' , WEBROOT . " css/ " ); define ( ' IMG ' , WEBROOT . " img/ " ); define ( ' JS ' , WEBROOT . " js/ " ); define ( ' DS ' , ROOT . " / " ); require_once ROOT . ' /vendor/autoload.php ' ; require_once APP . ' /core/App.php ' ; require_once APP . ' /database.php ' ; Also i need to require 3 files autoload.php : composer's a...

What is NoSQL?

Image
NoSQL , "not only SQL" means that  databases are not based on the classical architecture of relational databases. Originally developed to manage big data , the NoSQL database use has exploded in recent years. But what really NoSQL?         Types of NoSQL When speaking of NoSQL, we are including database systems that are not relational, but be aware that there are several types of databases "NoSQL". The key / value based , used to store information in the form of a key / value pair where the value can be a string, integer, or a serialized object. A Redis database. This type of database offers very good performance by its simplicity and can even be used to store user sessions or the cache of your website for example. Oriented databases columns , similar to relational databases because the data is saved as a line with columns, but is distinguished by the fact that the number of columns may vary from line to line. The best known solutions ...