Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41656 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69633 invoked from network); 4 Nov 2008 18:00:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2008 18:00:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=steph@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=steph@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 64.99.136.133 as permitted sender) X-PHP-List-Original-Sender: steph@php.net X-Host-Fingerprint: 64.99.136.133 smtprelay-virgin0133.hostedemail.com Received: from [64.99.136.133] ([64.99.136.133:60923] helo=smtprelay-virgin.hostedemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/BB-15458-0BD80194 for ; Tue, 04 Nov 2008 13:00:26 -0500 Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay07.hostedemail.com (Postfix) with SMTP id D7F8EFD257; Tue, 4 Nov 2008 17:59:59 +0000 (UTC) X-SpamScore: 1 X-Spam-Summary: 2,0,0,db484d6aa37fd542,691ff1dea13fdf9b,steph@php.net,et@php.net:internals@lists.php.net,RULES_HIT:355:379:539:540:541:542:543:567:599:601:945:982:988:989:1155:1156:1260:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1541:1587:1593:1594:1711:1730:1747:1766:1792:2073:2075:2078:2194:2199:2393:2559:2562:2731:2828:3027:3353:3622:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3876:3877:5007:6114:6119:6261:7653:7875:7903:8501:9108,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:none,DNSBL:none Received: from foxbox (62-31-252-63.cable.ubr07.shef.blueyonder.co.uk [62.31.252.63]) (Authenticated sender: steph.fox) by omf13.hostedemail.com (Postfix) with ESMTP; Tue, 4 Nov 2008 17:59:58 +0000 (UTC) Message-ID: <03a101c93ea7$6b619e70$3ffc1f3e@foxbox> To: "Stefan Walk" , References: <49048EC1.9060908@chiaraquartet.net> <200811041819.25933.et@php.net> <033501c93ea2$ab332690$3ffc1f3e@foxbox> <200811041836.54963.et@php.net> Date: Tue, 4 Nov 2008 18:01:51 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-session-marker: 73746570682E666F78 Subject: Re: [PHP-DEV] namespace separator and whining From: steph@php.net ("Steph Fox") Hi Stefan, >> Dev writes a script, uses autoload, overrides global class. >> > Distributed to user, that has ns.lookup=On as you propose, user borks >> > his >> > install, lacks the file containing the class, gets the global class -> >> > obscure error messages because of nonexisting methods in places >> > unrelated >> > to >> > the place where the actual error happened. Not really a good idea, IMO. >> >> This is what happens now, right. So what's different? > > With the proposed change -- failing at "step 3", it doesn't. It fails at > the > time that you try to create the instance, saying the class was not found, > which is actually the case. For clarity... Current behaviour: 1) check for namespaced\classname 2) check for internal classname 3) try to autoload namespaced\classname 4) fail Proposed (Stas, Greg): 1) check for namespaced\classname 2) try to autoload namespaced\classname 3) fail What I'm suggesting is a configurable switch between that proposed order and: 1) check for namespaced\classname 2) try to autoload namespaced\classname 3) check for internal classname 4) fail >> > Failing there is the best option. It's not like you have to prefix >> > every >> > single occurence, you just have to say at the top of the file "When I >> > say >> > Exception, I mean \Exception". >> >> The point is that your dev would have done exactly that, so whether your >> user has the setting on or off is immaterial. >> >> - Steph > > No, the dev didn't mean \Exception, he meant *his* exception, the one that > he > has in the current namespace, and any way your setting would not have > resulted in any error, because for the dev, autoload worked. I see your point. OK, thanks. - Steph