Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-02-2008, 09:34 PM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Smile Tip to make error messages easier to read!

Here are two lines of code that will make your error messages easier to read. These two lines should be put in your bootstrap file:

// Make error messages easier to read
ini_set('error_prepend_string', '<pre>');
ini_set('error_append_string', '</pre>');

What it simply does is wrap the error message in <pre> tags so that line breaks remain intact
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-03-2008, 08:20 AM
Junior Member
 
Join Date: Nov 2007
Location: Sweden
Posts: 12
Default

Nice one, been looking for that kind of code =)
In the background what does it do? Does ZF ask for "error_prepend/append_string" when it it throws an error? I did create my own php loop to take care of it but this was easier for sure =) ....though the long error messages will go out of screen on your right, is there someway to wrap lines aswell?

Thanks for the tip.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-03-2008, 02:55 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

Since they are INI settings, this happens when PHP throws an error, and is done outside of the ZF.

> hough the long error messages will go out of screen on your right, is there someway to wrap lines aswell?

Not with
HTML Code:
<pre></pre>
by itself. HOwever, you should be able to add some style to it with CSS to make it work like you want.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-03-2008, 08:02 PM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Default

Quote:
Originally Posted by xentek View Post
Since they are INI settings, this happens when PHP throws an error, and is done outside of the ZF.

> hough the long error messages will go out of screen on your right, is there someway to wrap lines aswell?

Not with
HTML Code:
<pre></pre>
by itself. HOwever, you should be able to add some style to it with CSS to make it work like you want.

Yes, you could maybe make the font size really small.

PHP Code:
// Make error messages easier to read
ini_set('error_prepend_string''<pre style="font-size:8px">');
ini_set('error_append_string''</pre>'); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:43 PM.