Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68811 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44630 invoked from network); 1 Sep 2013 09:13:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Sep 2013 09:13:46 -0000 Authentication-Results: pb1.pair.com header.from=florinpatan@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=florinpatan@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: florinpatan@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:37081] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/CE-55332-94503225 for ; Sun, 01 Sep 2013 05:13:46 -0400 Received: by mail-ob0-f170.google.com with SMTP id eh20so3515082obb.29 for ; Sun, 01 Sep 2013 02:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=RCh/iDwdrCpyiDy46ilZWol6BTnL5F2wZvlP521BqPM=; b=uMXrh6DmjNHYTNZ25IyKL9f8NV+v47luU0eZFGFbFdMMteb+j86KUXkHnJ4UOiqr/h eJDOq34LmF+6VvaptEWplxEk9GgPwM0O9sL74q8AAgBUg2ftyF57NRTttHsgk0RQUoZU aOpAks/Chw9APAeYBCKIBUAJ3IfVNweojIGsXBDa3NCCIz9VK+exdJWcHzP+gYlE5jYD JmVgip2eUIGstnoTAmgiPkLyCIGyj+vESSPqT+QJvzhD9iG/06cRB8NPcfWNZQ3iVBNJ 3THZyGJGQmB7sPTruARLGhvLFZL17OOKbYG42qb6V2q7t0DWQ/JAW5sJ1IuR+g/IhaP2 esvw== X-Received: by 10.182.51.132 with SMTP id k4mr13040184obo.101.1378026823145; Sun, 01 Sep 2013 02:13:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.85.133 with HTTP; Sun, 1 Sep 2013 02:13:13 -0700 (PDT) In-Reply-To: References: <5220262A.6040702@sugarcrm.com> <5220437A.7050008@sugarcrm.com> <5220D212.3010101@sugarcrm.com> <61FCD6C4A31248078FEAD2BA73D7CD44@gmail.com> <7AF31CC1D1554454AC95AE758D23E92E@gmail.com> Date: Sun, 1 Sep 2013 11:13:13 +0200 Message-ID: To: Anthony Ferrara Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: Function autoloading From: florinpatan@gmail.com (Florin Patan) On Sun, Sep 1, 2013 at 1:11 AM, Anthony Ferrara wrote: > All, > > There has been a lot of discussion unto the merit of this feature. That's > fine. > > What I'd really like to know before proposing this is what can be improved > in this RFC. > > For example: someone (Stas) brought up that it was weird that all three > types (Class, Function, Constant) are served by a single register function > (and multiple can be served by a single autoloader). Personally, I see this > as a significant simplification advantage, but I can see if others don't. > If you don't, can we please try to ideate around coming up with a better > syntax? I think adding two different functions and maintaining the general one could be the way to go in this case. The function names might look like this: - spl_register_autoloader -> autoloader for everything - spl_register_function_autoloader -> autoloader for functions/consts - spl_register_class_autoloader -> current autoloader for classes only Thinking on how PSRs work, one might register one autoloader for classes and if they don't use any function/constant autoloading then they don't need to take care of supporting them in the autoloader. When a new PSR for function/constat autoloading will appear, that loader could be registered to it's own 'spl_register_function_autoloader()'. If there'll be a special PSR that covers both then that loader will need to call 'spl_register_autoloader()' and that's it. I'm sure the names could be improved. > > Another example: I've received a lot of feedback that using the "php" root > namespace is weird and unexpected. Does anyone agree? Should that be > changed prior to proposing this feature? Could we have something like the global namespace for classes where '\' is the default namespace? Or maybe alias php\ to \ namespace auto-magically? > Let's try to improve this RFC to be the best it can prior to proposing and > voting. Even if you don't think it's necessary, there are surely things you > think can be improved (and hence everyone wins). > > Thanks > > Anthony > > Those are the idea that I have in regards to this RFC. Hope they help. Kind regards, Florin Patan https://github.com/dlsniper http://www.linkedin.com/in/florinpatan