On Mon, Mar 9, 2009 at 8:53 PM, David Mintz <[email protected]> wrote:
> I suppose this is not even ZF-specific, but...
>
> I have been doing some Ajax stuff, intentionally outputting content-type
> javascript/application followed by javascript code for the client to eval.
> Working away, all is well until suddenly my javascript is being returned as
> text/html. After a lot of diagnostic echo() I finally narrowed it down to
> the fact that I had introduced a syntax error in a class that was being
> instantiated along the way. (Too bad Zend Studio's usual red syntax
> error-flagging is not working today.)  There was nothing in the browser
> output stream (at last not by the time it got to me) and nothing in any
> error log by way of error message about this condition. But MY content-type
> header was apparently being overwritten by the default text/html, it seems,
> once execution blew up.
>
> The whole thing is really weird, and quite a cruel torture. (I know, I
> should learn to properly use a proper debugger and I swear I will some day
> before they put a toe-tag on me --- or cart me away to the psychiatric
> hospital.)
>
> Has this happened to you? If so, what do you do to safeguard against it
> happening again?

Yes, of course.

I safe guard with the following measures:

a) error_log (php.ini) is setup and I have a terminal open with tail -f on it
b) I usually also have a listener on the log which adds a notice on our CI setup
c) I have a task to "php -l" all files in our CI setup -- evaluates a
file for "syntax errors"

Hope that helps,
Till

Reply via email to