Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68743 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67862 invoked from network); 30 Aug 2013 17:25:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2013 17:25:04 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.67 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.67 smtp67.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.67] ([108.166.43.67:51273] helo=smtp67.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/87-32511-E65D0225 for ; Fri, 30 Aug 2013 13:25:04 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id A76A1148254; Fri, 30 Aug 2013 13:25:00 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp1.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 579DF148170; Fri, 30 Aug 2013 13:25:00 -0400 (EDT) Message-ID: <5220D56E.40205@sugarcrm.com> Date: Fri, 30 Aug 2013 10:25:02 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Anthony Ferrara CC: "internals@lists.php.net" References: <5220262A.6040702@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [DRAFT] [RFC] Function autoloading From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > As far as complicated and fragile logic, as Nikita pointed out, you > could put all of your functions inside of a "functions,php" in a It's the same as making it Functions.php and a class. I don't see why we should overhaul the autoloading in the engine and add so many complexity just to avoid writing the word "class". > Or, alternatively, you can keep a mapping of function->filename. There's > no need or requirement for one-class, one-function or one-constant. One-class-per-file is a very frequent usage pattern. One-function-per-file never happens. That's the difference. > Furthermore, I think that's up to the community to decide how to do. > They mostly settled on a 1-class-to-1-file rule (which was not the case > prior to __autoload/spl_autoload). I am fully confident that they will > find a way that makes sense, if given the ability. This sounds like a solution in search of a problem. I don't think we should create solutions for problems that do not exist and then tell people "now go find some problem that may fit this neat code that I've added to the engine". We should first identify the need and only then mess with the engine, not the other way around. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227