On Feb 14, 2011, at 16:14, Renato de Freitas Freire wrote:

> I got a new challenge: Develop a socket server for an existing system written 
> in cakephp.
> I would like to create this socket server with cakephp too.
> Is it possible?
> 
> Let me show my scenario, so if anyone have other ideas, I would appreciate to 
> listen.
> 
> I have a system where the employees work the whole day.
> They get data from database, check, edit, save, update, etc.
> The supervisors want to be able to monitor their team in real time.
> Like, if some employee keep being lazy, the supervisor want to be able to 
> send him a message, alerting to stop being lazy and get to work.
> 
> So, figure it out:
> Im the employee and I dont want to work today. 
> So I open a record in my computer and leaves it opened all day, so when my 
> supervisor come see my computer, he will think Im working, but Im not.
> The supervisor cant see if its the same record or the other one, because the 
> form is very large, so I (the employee) can scroll the screen down.
> The supervisor will know that I didn't work only in the end of the day, but I 
> am a temporary employee.
> So, when the supervisor figure that I didn't work, I will be in my house with 
> my payment. 
> 
> In this new control system, the supervisor will be able to stay in their 
> computer watching the employees to work.
> If some employee try to skip the job, the supervisor will be able to see, or 
> the system could color the name of the employee to alert the supervisor.
> It needs to be like a control console for the supervisors.
> 
> The system where the employees work is written in cakephp.
> 
> I think of two solutions:
> 
> 1. Sockets
> 2. Ajax
> 
> Can anyone help me with this doubt?
> 
> Which one is better?
> Wont ajax consume a lot of network band?
> Will sockets consume a lot of processor or memory?
> 
> Can anyone point me the way to start? Or give any advice?
> 
> I have some experience in cakephp development.
> Ive been developing with php the past 5 years and with cake the past 2 years.
> 
> I already did something like that, but in Java/Servlets.
> But my scenario (server, actual system) is written in php.

I don't understand how using ajax or sockets will solve this problem.

Sockets means a way to open a network connection between one program and 
another -- for example, between a PHP script running on your web server and 
another program running somewhere else. Sockets are for when you want to deal 
directly with the bytes being sent and received, and an existing higher-level 
protocol like HTTP or FTP is unsuitable.

Ajax is a term for JavaScript code running in a web browser on a web page 
designed to let that web page retrieve additional information from a web server 
without needing to reload the entire page.

I don't see how sockets relate to the problem at all.

I could see employing ajax in a kind of near-realtime manager control panel, 
where they could see which employee is currently working on what, or see totals 
for what each employee has done that day. Ajax would not be a requirement for 
that, it would just make the interface a little slicker. But you could 
certainly get by without it, and just refresh the entire page occasionally.

So perhaps you should explain exactly what you're trying to build, if you need 
help with that.


> One more question:
> The actual system is running in cake 1.2, should I create this new system in 
> cake 1.2 or cake 1.3?

Of course I would always recommend upgrading to the latest stable version. If 
you're migrating an existing app from 1.2 to 1.3 there are some steps you'll 
have to perform; see the documentation.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to