Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56615 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43905 invoked from network); 25 Nov 2011 08:06:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2011 08:06:37 -0000 Authentication-Results: pb1.pair.com header.from=christian.kaps@mohiva.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=christian.kaps@mohiva.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mohiva.com from 80.67.31.26 cause and error) X-PHP-List-Original-Sender: christian.kaps@mohiva.com X-Host-Fingerprint: 80.67.31.26 smtprelay03.ispgateway.de Linux 2.6 Received: from [80.67.31.26] ([80.67.31.26:44315] helo=smtprelay03.ispgateway.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/63-16974-B8C4FCE4 for ; Fri, 25 Nov 2011 03:06:36 -0500 Received: from [80.67.16.111] (helo=webmail.df.eu) by smtprelay03.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1RTqnp-0002gS-75 for internals@lists.php.net; Fri, 25 Nov 2011 09:06:33 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 25 Nov 2011 09:06:33 +0100 To: In-Reply-To: References: <4ECEC513.9040706@mohiva.com> Message-ID: <06acba1a1c53ac9527beb807787c92aa@mohiva.com> X-Sender: christian.kaps@mohiva.com User-Agent: Roundcube Webmail/0.6 X-Df-Sender: Y2hyaXN0aWFuLmthcHNAbW9oaXZhLmNvbQ== Subject: Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling From: christian.kaps@mohiva.com (Christian Kaps) Am 25.11.2011 08:24, schrieb Michael Wallner: > On Thu, 24 Nov 2011 23:28:35 +0100, Christian Kaps wrote: > >> >> https://wiki.php.net/rfc/autoloader_error_handling >> > > Throwing an exception or fatal error in an autoloader > absolutely does not make any sense in my eyes. > Projects doing this should step back and think a > minute about what they dare. > > Mike Hi, how would you bring your application in a consistent state after a class couldn't be loaded. I do this by adding a try/catch block around my code. try { new Application(); } catch (Exception) { // collect data // send mail // redirect to maintenance page } An other question is, if the autoloader work silent and I write: new NotExistingClass(); I think in this case the engine will also trigger a fatal error. So in my eyes it is regardless of whether it trigger a fatal error in the autoloader or the autoloader works silent. Both cases ends in a fatal error. Or am i wrong here? Christian