Re: Trailing Whitespace Prevented a Session From Being Started

2008-03-09 Thread Stephen Orr

Is Zend Framework a big enough open-source project for you? They
follow this convention.

Steve

On Mar 8, 8:31 pm, Guy Rutenberg <[EMAIL PROTECTED]> wrote:
> Hi rtconner,
>
> On Mar 8, 1:52 am, rtconner <[EMAIL PROTECTED]> wrote:
>
> > FYI, It might be a good practive not to use the '?>' to close off your
> > php files. PHP closes when it hits the EOF anyways. I've seen some
> > projects that do this, it works well.
>
> It's a nice thing to know. Do you know of any open-source project that
> use this as their coding guidelines?
> If this is even a somewhat used coding convention (I must admit I
> never saw it before) in some big/medium open-source projects I will
> want to consider using it too.
>
> Regards and thanks for your tip,
>
> Guy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Trailing Whitespace Prevented a Session From Being Started

2008-03-08 Thread Guy Rutenberg

Hi rtconner,

On Mar 8, 1:52 am, rtconner <[EMAIL PROTECTED]> wrote:
> FYI, It might be a good practive not to use the '?>' to close off your
> php files. PHP closes when it hits the EOF anyways. I've seen some
> projects that do this, it works well.

It's a nice thing to know. Do you know of any open-source project that
use this as their coding guidelines?
If this is even a somewhat used coding convention (I must admit I
never saw it before) in some big/medium open-source projects I will
want to consider using it too.

Regards and thanks for your tip,

Guy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Trailing Whitespace Prevented a Session From Being Started

2008-03-07 Thread rtconner

FYI, It might be a good practive not to use the '?>' to close off your
php files. PHP closes when it hits the EOF anyways. I've seen some
projects that do this, it works well.

On Mar 7, 3:50 pm, Guy Rutenberg <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've came across a problem (which was completely my mistake), which
> caused the session in one of the controllers not to start properly
> (actually at all). The problem was caused as I found out by a trailing
> newline after the closing php tag in that controllers code.
>
> I think it would be nice that in the __startSession() method in cake/
> libs/session.php there will be a debug notice when a session is
> created after the headers were already send (instead of silently
> ignoring that). I think that in most cases when someone tries to
> initiate the session after sending the headers, it usually means he
> had some mistake (like a trailing whitespace).
>
> Currently, all the errors generated in this event are quite misleading
> ("Config doesn't exist" is the error returned by the session component
> and the session seams to be invalid). A better error message can be a
> nice thing to help developers spot such annoying problems.
>
> Just posted it in hope that if someone else runs into a similar
> problem it might help him save some debug time.
>
> Regards,
>
> Guy
>
> N.B.
> I've written some more detailed description of the problem, and where
> to modify the code to notify about such event 
> inhttp://www.guyrutenberg.com/2008/03/08/trailing-whitespace-causes-a-s...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Trailing Whitespace Prevented a Session From Being Started

2008-03-07 Thread Guy Rutenberg

Hi,

I've came across a problem (which was completely my mistake), which
caused the session in one of the controllers not to start properly
(actually at all). The problem was caused as I found out by a trailing
newline after the closing php tag in that controllers code.

I think it would be nice that in the __startSession() method in cake/
libs/session.php there will be a debug notice when a session is
created after the headers were already send (instead of silently
ignoring that). I think that in most cases when someone tries to
initiate the session after sending the headers, it usually means he
had some mistake (like a trailing whitespace).

Currently, all the errors generated in this event are quite misleading
("Config doesn't exist" is the error returned by the session component
and the session seams to be invalid). A better error message can be a
nice thing to help developers spot such annoying problems.

Just posted it in hope that if someone else runs into a similar
problem it might help him save some debug time.

Regards,

Guy

N.B.
I've written some more detailed description of the problem, and where
to modify the code to notify about such event in
http://www.guyrutenberg.com/2008/03/08/trailing-whitespace-causes-a-session-to-be-destroyed-in-cakephp/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---