Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56617 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49658 invoked from network); 25 Nov 2011 08:56:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2011 08:56:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sebastian.krebs.berlin@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.214.42 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@googlemail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:56397] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/80-45850-5285FCE4 for ; Fri, 25 Nov 2011 03:56:09 -0500 Received: by bkbzt4 with SMTP id zt4so4193697bkb.29 for ; Fri, 25 Nov 2011 00:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:sender:x-google-sender-delegation:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=gSlwTVZMEILrYnQysu53XrzkQzRCWpfwTCdbXGRol2g=; b=M6xc4AZtYRBogodidOmF6yLmBsXqsPgmSBL3WFts+IlVgtqxcFDLNKv3YIfsf5FX2l 3csnW7b3B0FVPYXdg3J2hB6UcsYCckTiAfFHO8fRczXaR501ODryG1rvY91GHKjrv8wB OmDJPhQS/3UzVvJt0npUzeTDNyh7YygsmAKuY= MIME-Version: 1.0 Received: by 10.205.132.146 with SMTP id hu18mr32484548bkc.123.1322211361506; Fri, 25 Nov 2011 00:56:01 -0800 (PST) Sender: sebastian.krebs.berlin@googlemail.com X-Google-Sender-Delegation: sebastian.krebs.berlin@googlemail.com Received: by 10.204.22.11 with HTTP; Fri, 25 Nov 2011 00:56:01 -0800 (PST) In-Reply-To: <06acba1a1c53ac9527beb807787c92aa@mohiva.com> References: <4ECEC513.9040706@mohiva.com> <06acba1a1c53ac9527beb807787c92aa@mohiva.com> Date: Fri, 25 Nov 2011 09:56:01 +0100 X-Google-Sender-Auth: 0A8uXgZx1c6T46lCyh-gbjtpBTU Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=000e0ce02ace85463304b28b52d8 Subject: Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling From: krebs.seb@googlemail.com (Sebastian Krebs) --000e0ce02ace85463304b28b52d8 Content-Type: text/plain; charset=ISO-8859-1 Hi, Just to throw my 2 cent in: Im with Micheal. An application, that tries to access a class, that doesn't exists, is broken and a FATAL is valid. This application doesn't need try-catch, but a bugfix (and if it is already released: A better testing management). On the other side an application, that makes use of dynamic class names should make use of class_exists() in any case. An exception after calling class_exists() is just bad, but the classloader cannot distinguish between the reasons, why it is called. 2011/11/25 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 > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --000e0ce02ace85463304b28b52d8--