Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17166 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60213 invoked by uid 1010); 7 Jul 2005 14:58:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 60198 invoked from network); 7 Jul 2005 14:58:07 -0000 Received: from unknown (HELO gmail.com) (127.0.0.1) by localhost with SMTP; 7 Jul 2005 14:58:07 -0000 X-Host-Fingerprint: 63.118.113.4 miami4.us.univision.com Received: from ([63.118.113.4:7078] helo=localhost.localdomain) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 26/00-59389-FF24DC24 for ; Thu, 07 Jul 2005 10:58:07 -0400 Message-ID: <26.00.59389.FF24DC24@pb1.pair.com> To: internals@lists.php.net References: <84.75.05285.5EA7CC24@pb1.pair.com> <28139bc05070705364cc572f7@mail.gmail.com> Date: Thu, 7 Jul 2005 10:58:09 -0400 Lines: 48 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Posted-By: 63.118.113.4 Subject: Re: [PHP-DEV] YANP (Yet Another Namespace Proposal) From: jrhernandez05@gmail.com ("Jessie Hernandez") I'm still debating whether importing all symbols from a namespace is a good idea or not (I sometimes use Java at work, and I never import a full package myself, and this is not recommended anyways). But, if it were to be implemented, then below is how I would approach it. The following would be required: 1) As I said before, the "class_path" php.ini variable would be used for imports. 2) Each file under the class_path is named exactly like the class that it declares. For example, my_namespace/my_class.php would define the class "my_class" under the my_namespace namespace (just like in Java). If an "import namespace my_namespace;" (the syntax is still tentative) statement is found, then the directory /my_namespace will be opened (at compile-time). Each file under this directory would be imported. So, assuming our class_path is "/usr/local/php-classes" and the "/usr/local/php-classes/my_namespace" directory had two files, "class1.php" and "class2.php", then this is what would happen: There would also need to be another hashtable to indicate if a full namespace import for a particular namespace has already been done or not, to avoid a directory from being read over and over again. -- Jessie "Xuefer" wrote in message news:28139bc05070705364cc572f7@mail.gmail.com... at compile time? this means u cannot import * (all) symbols from a namespace