Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44358 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92516 invoked from network); 18 Jun 2009 15:44:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jun 2009 15:44:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.212 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.217.212 mail-gx0-f212.google.com Received: from [209.85.217.212] ([209.85.217.212:45493] helo=mail-gx0-f212.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/C3-08167-1E06A3A4 for ; Thu, 18 Jun 2009 11:44:36 -0400 Received: by gxk8 with SMTP id 8so69674gxk.23 for ; Thu, 18 Jun 2009 08:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=QWeEPBQRG4J8iskZM/dCZDr7lzbB97cfLlnLR4cfTK0=; b=Kz00SsMiy4wpdlALSujvxetMtvJnR3pyiNt1BS09mKFF7Ly3Roio4zekOzNUHEElGP cjjiHnA+MR+9DE3JvhTXEzh+dfrFu2Mf4QySemDNrpHt2oRF6hHkXKWpNNc0Jt06ZaDo Jm+cGyZ+sve0As4fPF5/KXTJnti3n13F3JMlg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=NULoCXb0TG05LmW8Y5pHa1VzRS/+iuQFHgK0vJ+B4jRhVhrBPw7VYSSmEYeDS3CJpN FUi/r4C84HfiJl2cfFYk+2RazfueMrGoPPbpQlEH7cNDzMa8v1a10dI12CkLfUGPY6Bo TIWg8ZZ+pzBlRdyDpdrLqGB7usqBrZjEh8NUU= MIME-Version: 1.0 Received: by 10.231.39.4 with SMTP id d4mr532986ibe.10.1245339869632; Thu, 18 Jun 2009 08:44:29 -0700 (PDT) Date: Thu, 18 Jun 2009 12:44:29 -0300 Message-ID: To: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [PATCH] Inclusion of new constant: NS_SEPARATOR From: guilhermeblanco@gmail.com (Guilherme Blanco) Hi guys, First of all, don't laugh! =3DD The idea and patch are extremely simple. Based on recent experiments with Namespaces and FQCN thing I spoke with Johannes a couple of days ago, I decided to dive into source and try a possible patch. That's my first attempt to contribution to internals. Mainly I try to help on PHP side. The idea is to create a new global constant NS_SEPARATOR to be used. I know constants are used to represent internal values or values that differ between different OS's, but the main idea here is to prevent possible issues from user land and also to help people that do not have "\" key in their keyboard (like finnish keyboards). Here is a clear usage of this new constant: http://www.php.net/manual/en/language.namespaces.dynamic.php#91552 I don't really know if the file is the right one to have this constant, but it works for me perfectly. Index: Zend/zend_constants.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /repository/ZendEngine2/zend_constants.c,v retrieving revision 1.71.2.5.2.7.2.17 diff -u -r1.71.2.5.2.7.2.17 zend_constants.c --- Zend/zend_constants.c 12 Jan 2009 21:54:37 -0000 1.71.2.5.2.7.2.17 +++ Zend/zend_constants.c 18 Jun 2009 15:29:52 -0000 -151,6 +151,13 @@ c.value.type =3D IS_BOOL; zend_register_constant(&c TSRMLS_CC); } + + /* Namespace separator constant */ + static char nssep_str[2]; + nssep_str[0] =3D '\\'; + nssep_str[1] =3D '\0'; + + REGISTER_MAIN_STRING_CONSTANT("NS_SEPARATOR", nssep_str, CONST_PERSISTENT | CONST_CS); } Cheers, --=20 Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco@hotmail.com URL: http://blog.bisna.com S=C3=A3o Paulo - SP/Brazil