Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31225 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4773 invoked by uid 1010); 23 Jul 2007 18:51:58 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 4758 invoked from network); 23 Jul 2007 18:51:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2007 18:51:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=andrew.minerd@sellingsource.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andrew.minerd@sellingsource.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sellingsource.com from 208.67.190.52 cause and error) X-PHP-List-Original-Sender: andrew.minerd@sellingsource.com X-Host-Fingerprint: 208.67.190.52 mail2.sellingsource.com Received: from [208.67.190.52] ([208.67.190.52:52744] helo=mail2.sellingsource.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/BF-27148-CC8F4A64 for ; Mon, 23 Jul 2007 14:51:57 -0400 Received: from localhost (localhost [127.0.0.1]) by mail2.sellingsource.com (Postfix) with ESMTP id 777C548C485; Mon, 23 Jul 2007 11:51:52 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at mail2.sellingsource.com Received: from mail2.sellingsource.com ([127.0.0.1]) by localhost (mail2.sellingsource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hAmt3G6Doc5m; Mon, 23 Jul 2007 11:51:51 -0700 (PDT) Received: from h4x0r.tss (unknown [208.67.191.194]) by mail2.sellingsource.com (Postfix) with ESMTP id C128048C480; Mon, 23 Jul 2007 11:51:51 -0700 (PDT) Date: Mon, 23 Jul 2007 11:52:09 -0700 To: Markus Fischer Cc: Stanislav Malyshev , 'PHP Internals' Message-ID: <20070723115209.22d1ebd3@h4x0r.tss> 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> Organization: The Selling Source, Inc. X-Mailer: Claws Mail 2.9.1 (GTK+ 2.10.11; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Question about Namespace patch From: andrew.minerd@sellingsource.com (Andrew Minerd) Markus, > > import Zend::DB; > > import My::DB; > > import Woot::Database as DB; > > I don't quite understand your example. The issue was that importing an entire namespace would introduce the possibility of name conflicts. My point was simply that conflicts could still exist, so that argument is pointless. Andrew Minerd Software Architect The Selling Source, Inc. On Mon, 23 Jul 2007 20:40:19 +0200 Markus Fischer wrote: > -----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-----