Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33948 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49864 invoked by uid 1010); 11 Dec 2007 23:59:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 49849 invoked from network); 11 Dec 2007 23:59:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2007 23:59:02 -0000 Authentication-Results: pb1.pair.com header.from=dz@bitxtender.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dz@bitxtender.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain bitxtender.com from 80.237.132.12 cause and error) X-PHP-List-Original-Sender: dz@bitxtender.com X-Host-Fingerprint: 80.237.132.12 wp005.webpack.hosteurope.de Received: from [80.237.132.12] ([80.237.132.12:33962] helo=wp005.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/02-38526-5442F574 for ; Tue, 11 Dec 2007 18:59:02 -0500 Received: from dslb-084-056-059-202.pools.arcor-ip.net ([84.56.59.202] helo=localhost); authenticated by wp005.webpack.hosteurope.de running ExIM using esmtpsa (TLSv1:RC4-SHA:128) id 1J2F07-0008DN-Cg; Wed, 12 Dec 2007 00:58:59 +0100 Cc: internals@lists.php.net Message-ID: <7B1F2979-6623-44A1-9EFF-3D3A914C65E2@bitxtender.com> To: Stanislav Malyshev In-Reply-To: <475F1C2F.8040802@zend.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Wed, 12 Dec 2007 00:58:58 +0100 References: <11970653983080000@9866357972520000.9866341568840000> <475BDDF1.7040605@ctindustries.net> <1723341090.20071210220025@marcus-boerger.de> <1197323296.3922.5.camel@sbarrow-desktop> <00A2E2156BEE8446A81C8881AE117F199A0715@companyweb> <475ED038.3080004@zend.com> <7F9E1E02-FF89-474B-9E94-007747B3637A@bitxtender.com> <475EF175.2030304@zend.com> <475F01B1.8090407@zend.com> <475F1152.3000400@zend.com> <124EB426-4EFC-4205-8254-E949ABA4A14B@bitxtender.com> <475F1C2F.8040802@zend.com> X-Mailer: Apple Mail (2.915) X-bounce-key: webpack.hosteurope.de;dz@bitxtender.com;1197417543;16721287; Subject: Re: AW: [PHP-DEV] Namespace resolution From: dz@bitxtender.com (=?ISO-8859-1?Q?David_Z=FClke?=) Am 12.12.2007 um 00:24 schrieb Stanislav Malyshev: >> namespace Name::Space; >> class Ship { >> public static function __autoload($className) { >> if(strpos($className, 'Name::Space::') === 0) { >> // the real deal >> } >> } >> } >> ... >> spl_autoload_register(array('Name::Space::Ship', '__autoload')); >> No disk access. And with my suggestion to allow limiting >> autoloaders to > > I don't understand. Is your autoloader going to do any disk accesses > at all or it's just a stub that doesn't load any classes? If it does > disk access, it would do it on any internal class access inside > namespace Name::Space. Please explain me in detail how it could ever > happen otherwise. I was assuming there was no need to explain that "// the real deal" is where the class loading goes. Look. If you have an autoloader for Your::Namespace, then you just need to check if the class name (which is fully qualified, with the entire namespace prefix in the name) starts with "Your::Namespace" to prevent disk access. David