<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><title> :: komentarze do wpisu &quot;Just before you lanuch a PHP application&quot;</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/</link><description>Wpisy z dziennika internetowego Jogger, wspomaganego przez Jabbera</description><lastBuildDate>Fri, 30 Jul 2010 16:00:58 +0200</lastBuildDate><generator>JoggerPL</generator><item><title>Dodek</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337142</link><description>&quot;What you should do instead is to develop automated reporting utility. With PHP it is super easy.&quot;You mean plain PHP? Altough I've never tried any of PHP frameworks, I can't help to notice that all serious Python web frameworks provide that functionality by default - usually you just need to configure it to suit your needs. This is the way of programming I would call &quot;super easy&quot;.</description><pubDate>Thu, 05 Feb 2009 13:43:45 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337142</guid></item><item><title>stronger</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337157</link><description>In this case it really doesn't make any difference whether you handle it manually or via framework. In both scenarios sending email should take no more than 3 lines of code. By &quot;super easy&quot; I mean that average PHP developer already possesses enough knowledge to implement any of my suggestions, whereas using framework would first require him/her to learn functionality provided by a framework in order to use it.To be fair I do believe the latter is cleaner/more appropriate.</description><pubDate>Thu, 05 Feb 2009 13:57:01 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337157</guid></item><item><title>Dodek</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337166</link><description>Sending an e-mail with 3 lines of code? That's unusual. Could you please tell me how is that supposed to work? Come to think of it, it is actually possible - if one's using some convenient facility for sending e-mails.  But if that's the case, it is no different than using a framework.</description><pubDate>Thu, 05 Feb 2009 14:07:38 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337166</guid></item><item><title>Michał Bachowski</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337344</link><description>@Dodek: have you ever heard about mail() function :&gt;? You don`t have to send whole backtrace via e-mail but instead write it to file and only notice yourself about that:try {// my app code goes herecatch( $e ) {    file_put_contents( $name = (time() . '.log'), print_r( $e-&gt;getTrace(), true ) );    mail( ja@ja.pl, 'Error you bastard!', &quot;New error occured. More details in file: $name&quot; );}Regards</description><pubDate>Thu, 05 Feb 2009 22:05:47 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337344</guid></item><item><title>Dodek</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337351</link><description>mail(), as far as I remember, requires you to setup an SMTP server, which is kind of uneasy task if it is supposed to be done well. That's why I used &quot;convenient facility&quot; phrase instead of &quot;third-party library&quot;.</description><pubDate>Thu, 05 Feb 2009 22:09:40 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337351</guid></item><item><title>Michał Bachowski</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337357</link><description>@Dodek: but usually you don`t have to set up an SMTP because it`s already prepared.BTW: Stronger, I beg you: update your post and write that errors should not be displayed on a screen :P (display_errors=off)Regards</description><pubDate>Thu, 05 Feb 2009 22:19:17 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337357</guid></item><item><title>stronger</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337629</link><description>@Dodek: mail() is a no-brainer in PHP world. And if it was a sane developer should write or use handy library to make it actual three-liner.@Michał: I would update if I was totally convinced it was right. I learned that leaving display_errors on results in better feedback from beta testers. The reason is I think that users not always realize that they found themselves in application's erroneous state, whereas offending them with some semi-programming cryptic junk output make them sure they encountered software problem.I would be hesitant leaving it &quot;on&quot; on production machine/stable release, tho.</description><pubDate>Fri, 06 Feb 2009 13:31:05 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337629</guid></item><item><title>MiB</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337633</link><description>@stronger: I agree with you, that leaving &quot;display_errors=on&quot; on development or staging server is right but on production server  it should be turned off ;)</description><pubDate>Fri, 06 Feb 2009 13:34:18 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1337633</guid></item><item><title>pldmachine</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1343391</link><description>There can also be a production server in phase ''beta'', which can be for example - first few months of work. And if I understood right:&quot;First, wrap whole application with try…catch statement. Once otherwise unhandled exception is thrown it gets sent via email.&quot; this means NO error will be displayed on the screen, no matter display_errors is Of or On.</description><pubDate>Tue, 17 Feb 2009 23:05:27 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1343391</guid></item><item><title>Michał Bachowski</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1343401</link><description>@pldmachine: putting everything between &quot;try... catch &quot; will suppress only exceptions. PHP hardly ever throws an exception ;P so that we should suppress errors by setting &quot;display_errors&quot; to &quot;Off&quot; ;)</description><pubDate>Tue, 17 Feb 2009 23:19:16 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1343401</guid></item><item><title>stronger</title><link>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1343633</link><description>pldmachine, Michał, surely catching exception is not enough for successful reporting, hence &quot;php_value error_log log/errors.txt&quot; above. PHP is known to be long standing sucker when it comes to exceptions.The thing is I am not 100% percent convinced that display_errors should be switched off on production box. To me it seems like choosing the lesser evil between &quot;a fuckup that nobody will ever report, except that the app is behaving mysteriously&quot; and &quot;a fuckup that is evident enough for immediate action&quot;. I would go for the latter.</description><pubDate>Wed, 18 Feb 2009 15:08:01 +0100</pubDate><guid>http://stronger.epsi.pl/2009/02/04/just-before-you-lanuch-a-php-application/#c1343633</guid></item></channel></rss>