Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31224 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2016 invoked by uid 1010); 23 Jul 2007 18:46:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2001 invoked from network); 23 Jul 2007 18:46:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2007 18:46:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=dz@bitxtender.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dz@bitxtender.com; 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:52673] helo=wp005.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/7F-27148-C97F4A64 for ; Mon, 23 Jul 2007 14:46:52 -0400 Received: from [87.79.35.58] (helo=[192.168.0.164]); authenticated by wp005.webpack.hosteurope.de running ExIM using esmtpsa (TLSv1:RC4-SHA:128) id 1ID2vh-0005Aw-1o; Mon, 23 Jul 2007 20:46:49 +0200 In-Reply-To: <46A4F613.6020807@fischer.name> References: <46A31D95.2080407@fischer.name> <46A4661A.6080202@zend.com> <200707231140.55535.pstradomski@gmail.com> <46A4BA4F.6090506@dealnews.com> <40CA6572-030F-43E2-8706-64D1167C527C@bitxtender.com> <46A4C090.50402@php.net> <3d1a63d10707230942y2b2504d1p5f995f01d28a622b@mail.gmail.com> <46A4DF33.1030403@zend.com> <20070723110303.0c033048@h4x0r.tss> <46A4EEBA.7040308@zend.com> <20070723112810.0428efdd@h4x0r.tss> <46A4F613.6020807@fischer.name> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <1CFA45A3-023A-4E62-8507-63AD00ED10AC@bitxtender.com> Cc: Andrew Minerd , Stanislav Malyshev Content-Transfer-Encoding: 7bit Date: Mon, 23 Jul 2007 20:46:48 +0200 To: PHP Internals X-Mailer: Apple Mail (2.752.2) X-bounce-key: webpack.hosteurope.de;dz@bitxtender.com;1185216412;63025838; Subject: Re: [PHP-DEV] Question about Namespace patch From: dz@bitxtender.com (=?ISO-8859-1?Q?David_Z=FClke?=) That's exactly how import w/ aliasing is supposed to be used, you got that perfectly right. David Am 23.07.2007 um 20:40 schrieb Markus Fischer: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Andrew, > > Andrew Minerd wrote: >> Well, first of all, not exactly. I think you meant: not import >> everything from two or more namespaces with conflicting names. >> Secondly, that's not the only solution. You could import >> everything from one, and not import from the other (or use a >> shorter prefix). Thirdly, you're not preventing collisions _at all_: >> >> import Zend::DB; >> import My::DB; >> import Woot::Database as DB; > > I don't quite understand your example. When I look at it in real > life, I > would go for: > > import Zend::DB as ZBD; > import My::DB as MDB; > import Woot::Database as DB; > > I mean, that's is the point, to have more readable code == shorter > identifiers, isn't it? > > So your code continues to read (just made up): > > $oZdb = ZDB::factor('mysql'); > $oMdb = MDB::getInstance('oracle'); > $oWdb = DB::getDriver('postgres'); > > instead of: > > $oZdb = Zend::DB:factor... > $oMdb = My::DB::getInstance > $oWdb = Woot::Database::getDriver.. > > Isn't that a win, at last? > > That's how I understood. Maybe I got that wrong. > > - - Markus > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFGpPYT1nS0RcInK9ARAmQmAKDGsYj/ZY0FNojQobKb3bK2NL6QDgCcDKgl > LnyIP65ymnx180f7/WD5WfM= > =LjpG > -----END PGP SIGNATURE----- > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >