Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17399 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23437 invoked by uid 1010); 26 Jul 2005 00:03:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23420 invoked from network); 26 Jul 2005 00:03:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2005 00:03:01 -0000 X-Host-Fingerprint: 65.9.70.25 adsl-9-70-25.mia.bellsouth.net Received: from ([65.9.70.25:24449] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6227M)) with SMTP id 34/C6-58254-4BD75E24 for ; Mon, 25 Jul 2005 20:03:01 -0400 Message-ID: <34.C6.58254.4BD75E24@pb1.pair.com> To: internals@lists.php.net Date: Mon, 25 Jul 2005 20:02:56 -0400 References: <52.31.61486.E8DCDD24@pb1.pair.com> <1122328113.647.16.camel@boost.home.ahk> Lines: 73 User-Agent: KNode/0.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Posted-By: 65.9.70.25 Subject: Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3 From: jrhernandez05@gmail.com (Jessie Hernandez) Alex Kiesel wrote: > Hi Jessie, > > first, while your patch applied cleanly (except zend_vm_opcodes.h, which > is generated) the build broke with: > bison -y -p zend -v -d > /mnt/home/alex/cvs/php-namespaces/Zend/zend_language_parser.y -o > Zend/zend_language_parser.c > conflicts: 5 shift/reduce > /mnt/home/alex/cvs/php-namespaces/Zend/zend_language_parser.y: expected 4 > shift/reduce conflicts *** Error code 1 > > I had to increase the expected shift/reduce conflict count to 5 to > continue the build, which then completed successfully. > I am no expert in bison or yacc, so could someone look at the patch and tell me what, if anything, is wrong, and how to fix it? > I don't like this idea; it restricts the developer to this Java-like > class / directory layout. It also restricts him to name his files after > the scheme you defined (which is .php) - many use other > schemes. Shouldn't PHP let you be free in this kind of decision? I think > yes, especially, as this could also be implemented with the __autoload > function in user-space. > The scheme is needed in order to locate class files for the classes that have been imported in a full namespace import. With no convention, we're forced to call __autoload, and since the only thing that will be passed is the class name, __autoload will have no way of knowing to what namespace that class belongs to. With the convention, each imported namespace's directory can be checked to see which one contains the class file. > Here's another one: the script > > $foo= 'Foo:Bar'; > import $foo; > ?> > > gives me > > alex@boost:~/cvs/php-namespaces# sapi/cli/php > ~/tests/classes/dynamic_import.php > > Parse error: parse error, unexpected T_VARIABLE, expecting > T_NAMESPACE_NAME or T_NAMESPACE in > /mnt/home/alex/tests/classes/dynamic_import.php on line 3 > > (IIRC Stanislav Malyshev already mentioned this in the YANP-thread > already.) > What Stanislav and I were discussing was not this, it was the following (variable class names), which is fully supported in the patch: Anyways, thanks for taking the time to try out the patch! Let me know if you have any other ideas/suggestions. -- Jessie