Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15794 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13019 invoked by uid 1010); 4 Apr 2005 15:28:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12309 invoked from network); 4 Apr 2005 15:28:23 -0000 Received: from unknown (HELO kiss.com) (127.0.0.1) by localhost with SMTP; 4 Apr 2005 15:28:23 -0000 X-Host-Fingerprint: 69.64.38.41 bluga.net Linux 2.5 (sometimes 2.4) (4) Received: from ([69.64.38.41:44550] helo=bluga.net) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id F5/8A-19272-B0D51524 for ; Mon, 04 Apr 2005 11:28:11 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by bluga.net (Postfix) with ESMTP id DCC5F21C713; Mon, 4 Apr 2005 10:25:39 -0500 (CDT) Received: from bluga.net ([127.0.0.1]) by localhost (bluga.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25560-03; Mon, 4 Apr 2005 10:25:39 -0500 (CDT) Received: from [192.168.0.102] (cpe-66-65-39-8.nyc.res.rr.com [66.65.39.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bluga.net (Postfix) with ESMTP id 9797B21C6D8; Mon, 4 Apr 2005 10:25:39 -0500 (CDT) Message-ID: <42515CFC.2050108@php.net> Date: Mon, 04 Apr 2005 11:27:56 -0400 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stanislav Malyshev Cc: internals@lists.php.net References: <5.1.0.14.2.20050403125628.03f83de0@localhost> <425002D8.50004@php.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at bluga.net Subject: Re: [PHP-DEV] Re: __autoload() enhancement From: cellog@php.net (Greg Beaver) Stanislav Malyshev wrote: > GB>>3. If a library has an obscure bug in __autoload, the only error message > GB>>the user will see is: > GB>> > GB>>"undefined class XXXX" > GB>> > GB>>If __autoload() is going to gain the ability to be defined for a > GB>>library, then the error messages must be enhanced as well. > > Shouldn't that bug result in some error message by itself? If it doesn't, > there's probably nothing to add to "undefined class" anyway. I meant a logic error - as in the user forgot to use a DIRECTORY_SEPARATOR and so can't find any of the classes, not an obvious PHP error. > > GB>>1) document that coders of __autoload() should throw an > GB>>autoload_exception if a class is not found > > Why just not return false or something? Exception is supposed to be used > when things are so bad you just can not continue. But I don't think class > not being found is such situation for autoload. > > On the other hand, I think that multiple autoload functions should be > evaluated in isoplated way - so that exception, etc. in one of them would > terminate it, but not the whole autoload process (i.e., next one would be > run). Perhaps a better solution is to simply augment the "undefined class XXX" method with a brief listing of all the defined __autoload() functions, so the user knows where to look for magic bugs. Greg