Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99480 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50588 invoked from network); 10 Jun 2017 19:13:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2017 19:13:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.85 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.85 mx104.easyname.com Received: from [77.244.243.85] ([77.244.243.85:49415] helo=mx104.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/A6-01593-DC44C395 for ; Sat, 10 Jun 2017 15:13:18 -0400 Received: from cable-81-173-132-37.netcologne.de ([81.173.132.37] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1dJlow-00084U-JR; Sat, 10 Jun 2017 19:13:14 +0000 References: <990f6d85-e3ed-05a4-42e0-d3a279c0ebe7@fleshgrinder.com> <277f53cd-0e79-6fcc-fa4b-b0527ca525b6@fleshgrinder.com> To: php-internals , Levi Morrison Message-ID: <3515b508-4571-0d57-6b47-616cae0b0908@fleshgrinder.com> Date: Sat, 10 Jun 2017 21:13:12 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sH3AVhcpiej6LVQniVtVFQJb1s4XkErTN" X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] [RFC] [Discussion] Namespaces in Core From: php@fleshgrinder.com (Fleshgrinder) --sH3AVhcpiej6LVQniVtVFQJb1s4XkErTN Content-Type: multipart/mixed; boundary="69nTBGthju77LUmPGnxrqv0KdxPOCATgF"; protected-headers="v1" From: Fleshgrinder To: php-internals , Levi Morrison Message-ID: <3515b508-4571-0d57-6b47-616cae0b0908@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC] [Discussion] Namespaces in Core References: <990f6d85-e3ed-05a4-42e0-d3a279c0ebe7@fleshgrinder.com> <277f53cd-0e79-6fcc-fa4b-b0527ca525b6@fleshgrinder.com> In-Reply-To: --69nTBGthju77LUmPGnxrqv0KdxPOCATgF Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/10/2017 8:54 PM, Levi Morrison wrote: > I gave this feedback before but I'll repeat it. I support namespaces > in the core, with the `PHP` namespace (with whatever capitalization we > decide) to be reserved *solely* for things related to the language > itself such as lexer, parser, etc. >=20 > I am fine with other extensions using namespaces but should use > appropriately named ones. Using the `PHP` namespace to indicate > something is packaged in core is a poor decision. We have moved > existing extensions into core and it would not make sense to rename it > simply because it was moved into core because it's a backwards > compatibility break. Similarly we've moved at least one extension out > of core and it doesn't make sense for it to have the `PHP` name when > it's not in core, but renaming it is yet other backwards compatibility > break. It's simply not prudent. Instead extensions should be named > after what they are, the vendor they are for, or some other name; this > is the same process user-land packages go through and core should not > be different. >=20 Thanks for that, much appreciated. This is exactly what I am proposing. Only things that are provided directly from the PHP Group should go into the PHP namespace. Any- and everything else should go into appropriate vendor namespaces. I think that you are considering e.g. array functions as not being part of PHP, and that you want to put them in a separate namespace. So effectively we would have something like: PHP\Lexer Arrays\Array IO\File Logging\Logger Reflection\Reflector Strings\String UUIDs\UUID I personally do not like this approach. PHP is the vendor of these things, thus, it should reside in the namespace of the vendor. Same rules for everyone. IO for instance is not a vendor, it is a particular use-case (working with files) and thus should not go directly into the global namespace. There is imho no reason to move `PHP\Reflection\Reflector` to `Reflection\Reflector` just because we decided, for whatever reason, to remove reflection from core and instead providing it via PECL. PHP would still be the vendor of it. The misconception that I am seeing is, that the PHP namespace is bound to PHP, which it isn't: it is the vendor namespace of the PHP Group. The PHP community at large has settled with this approach, and I believe that it is a very good approach. It effectively avoids namespace collisions and helps to identify the vendor of a particular implementatio= n. Would love to hear what others think about this. --=20 Richard "Fleshgrinder" Fussenegger --69nTBGthju77LUmPGnxrqv0KdxPOCATgF-- --sH3AVhcpiej6LVQniVtVFQJb1s4XkErTN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZPETIAAoJEOKkKcqFPVVrUCIQAKqgJq3bSl9iqw+bbuw5HO7p k9T8bywnuuqYDYtTixupW6v7Lz3aeegdN0ps0gg45QdvQDlpEhIhYBcjmRyOWT84 yl/r+sACYeOH2Qc/zSf+PUsF8dfDOp/Vv5Jo++EV4AMHisTKKJNDzq101rLWAFca gUH9vl5ELpqyfvJFcZ6DV+LZ3OoKJ/jh60acrMS3zkigdMkp6eZCz0q5ILzLHNI2 /tEwHhNw0Cqb5UR4su6iQ4OHFsj6okjkWAgPOaeMf6kypeChR70B7OdEzylKhpxs ScqOTY95VM0MQnCsz4OaMao/c94KrkOwwioxGHoRfua8nUw/67e/pV9JfZJ3chmA OxyIhsGKKaVaLN8jge/TLh4yIAGTwEi0RlO5NUOM8U1JYIrFkwAPj7NMXdVhvNEI 1bgb5TrjS5qwcxmYfAvPGczQ+ghIch8IxwfFvRA8zjgQO5FnLMjTpVUpkDjDaEUk icppP9TQZK+agzxc+GrQQ3x8dSWPWQAAHNAxMSF8+FZVAbaq6lIrEELm24t978GX CeosA0zIWc+48dNBFFdo4f1GAaHmcnMjAujoDAlJDvqh/98FOlTYD4jznQRjo2+k hE9CJEro5XlPuXZ10lGwztfR9COXVNy+V8KAhBudnBCi2EzoJBi585rUvpXKZK4O l2yGfGe7yP/QOVeeW4SA =VRF5 -----END PGP SIGNATURE----- --sH3AVhcpiej6LVQniVtVFQJb1s4XkErTN--