Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56273 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51727 invoked from network); 11 Nov 2011 08:52:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2011 08:52:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=christian.kaps@mohiva.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=christian.kaps@mohiva.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mohiva.com from 80.67.31.35 cause and error) X-PHP-List-Original-Sender: christian.kaps@mohiva.com X-Host-Fingerprint: 80.67.31.35 smtprelay01.ispgateway.de Linux 2.6 Received: from [80.67.31.35] ([80.67.31.35:35106] helo=smtprelay01.ispgateway.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/4B-17932-552ECBE4 for ; Fri, 11 Nov 2011 03:52:37 -0500 Received: from [80.67.16.114] (helo=webmail.df.eu) by smtprelay01.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1ROmqg-0003Px-AU for internals@lists.php.net; Fri, 11 Nov 2011 09:52:34 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 11 Nov 2011 09:52:34 +0100 To: In-Reply-To: References: Message-ID: <9274e90a58f9a9cffee6a2d9922e6ff9@mohiva.com> X-Sender: christian.kaps@mohiva.com User-Agent: Roundcube Webmail/0.6 X-Df-Sender: Y2hyaXN0aWFuLmthcHNAbW9oaXZhLmNvbQ== Subject: Re: [PHP-DEV] Re: SPLClassLoader RFC Thoughts And Improvements From: christian.kaps@mohiva.com (Christian Kaps) Hi .. snip .. >> Hm... so there should never have the normal available? >> I need to think over this again then. While I tend to agree with >> autoloader never triggering errors or exceptions, the debug mode is >> the unique way to notice if user during developer haven't done any >> mistake. >> Maybe we can only keep the RuntimeException and debug mode >> possibility, remove the normal and keep it always silent. What do >> you >> think? > > I think that an exception to this request could be made for the DEBUG > mode (as the way you're doing it is pretty much the only way you > could > identify that). Perhaps changing the exception to a warning or > notice > (as you wouldn't want that in prod), but I could live with the error > in debug mode as it shouldn't be used outside of testing and dev > work. > I was more referring to errors/exceptions in normal usage... > Would it not be possible that the autoloader mechanism catch all exceptions made by any autoloader which fails to load a class. Only if none of the register autoloaders can load the requested class the autoloader mechanism throws an AutoloadException with all the catched exceptions. This behaviour should be controllable by the users environment. So if using an autoloader(e.g. from a library) which throws an exception, but the user doesn't use exceptions in his environment, he should be able to deactivate the exceptions thrown by the autoloader mechanism. I think this behaviour has the greatest advantages for both worlds. This one which needs exceptions to shut down the application in an ordered way, and for these relying on PHPs way to handle the autoloading error. Cheers