librelist archives

« back to archive

Fwd: Re: [photon.users] Fwd: Re: Photon

Fwd: Re: [photon.users] Fwd: Re: Photon

From:
Loic d'Anterroches
Date:
2011-10-18 @ 12:11
Again, forwarding an off list interesting discussion which can be of
interest for the list. This is about logging/debugging.

-------- Original Message --------
Subject: Re: [photon.users] Fwd: Re: Photon
Date: Tue, 18 Oct 2011 14:07:37 +0200
From: Loic d'Anterroches <loic@ceondo.com>
Organization: Ceondo Ltd
To: Eldad Yamin <eldad87@gmail.com>

Hello,

> I tried to talk on the chat for few days, without success - no one answer :(

I am not always on the chat, if a lot to do, I am way more efficient
batching my answers by email than doing a lot of small answers on IRC.

> If I may, I have some more questions for you
> 
>    1. How can I debug the application?
>       Is there any way to do like xDebug?

Yes, just run xdebug and open the dump file. But another way is to put:
\photon\log\Log::setLevel('DEBUG');

in your config file and then:

use \photon\log\Log;

\Log::debug(array('Remote call' => 'http://foo',
                  'return_code' => 200));

in your code. By default it will write a log file in your defined tmp
folder.

What will soon change is that the default output for logging will be the
console.

loïc






>    2. Do you have any demo (using JS/Web sockets) how to build a chat
>       for iPhone?
>       Your chat example uses flash which doesn't work on iPhone.
> 
> 
> Thanks!
> 
> On Tue, Sep 20, 2011 at 9:53 AM, Loic d'Anterroches <loic@ceondo.com
> <mailto:loic@ceondo.com>> wrote:
> 
> 
> 
>     -------- Original Message --------
>     Subject: Re: [photon.users] Fwd: Re: Photon
>     Date: Tue, 20 Sep 2011 09:33:25 +0200
>     From: Loic d'Anterroches <loic@ceondo.com <mailto:loic@ceondo.com>>
>     Reply-To: photon.users@librelist.com <mailto:photon.users@librelist.com>
>     To: photon.users@librelist.com <mailto:photon.users@librelist.com>
> 
>     Hello,
> 
>     > I tried to install photon using the instillation guide.
>     > when I got to "hnu selftest" I got fatal error, the error was about
>     > missing file (something like 0MQ Context.php - I'll need to check what
>     > file was it tomorrow when I'll get to work).
> 
>     You need first to install the 0MQ extension.
> 
>     > In addition, I'm interesting in using it for developing
>     game-server so I
>     > have some questions:
>     > Is photon production-ready?
> 
>     Yes. Why, because it is extremely simple, this means the code is
>     extremely easy to debug and fix in case of issues. The goal of Photon is
>     just to provide the PHP level dispatching of the requests, so you can
>     reuse all the code of your other projects easily.
> 
>     > When Mongrel2 will reset the application (500 run times by default) -
>     > can I ask the server to not clear all the memory and keep some
>     variables
>     > in memory?
> 
>     Mongrel2 will never reset the application. They are totally independent
>     and only communicate over 0MQ. So yes, you can have a long running
>     background task storing some states. What you should do is simply dump
>     it on the disk some times to times to allow quick recovery if you move
>     the background task on another system or suffer a system restart.
> 
>     > Is there a way to use photon from source and not as
>     > the instillation guide instruct? in other words, I want to
>     download the
>     > photon source, 0MQ php source or install the extension and run photon.
>     > this will give me a much better understanding on how photon works/use
>     > photon/develop photon.
> 
>     Yes, just clone the repository.
> 
>     > I couldn't find documentation about the source and architecture, I
>     want
>     > to get a better understanding how it works in order to develop the
>     > framework itself. can you provide me with some explanations?
> 
>     Take a look at the \photon\core namespace. You have there the
>     dispatching of the request after getting it from Mongrel2.
>     Take a look at \photon\mongrel2 for the way the request is read from the
>     Mongrel2 message and converted into a \photon\http\Request object.
> 
>     loïc
> 
>