Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54200 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66725 invoked from network); 26 Jul 2011 08:51:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2011 08:51:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=sebastian.krebs.berlin@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sebastian.krebs.berlin@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: sebastian.krebs.berlin@googlemail.com X-Host-Fingerprint: 209.85.215.42 mail-ew0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:38835] helo=mail-ew0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/32-48186-C208E2E4 for ; Tue, 26 Jul 2011 04:51:57 -0400 Received: by ewy2 with SMTP id 2so222280ewy.29 for ; Tue, 26 Jul 2011 01:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=2Qbo4mE1/gNMNTz7VbbDVKobKm36yp3eduPcT8yMsuI=; b=TrN9/RFI2nK9hk2C9FnrajXhVnvqeMsQhx07UUOkzhzqrJ8jT0yNIyJjVcPbJOgTuE 4SLA45YMla0x855qAWBJCfBaMi6Be1OzjxaOICA2IfDQWXR7xBLrZJAqEL0ZroAftXgn ympm+tGf00mrTkbTKVm5f6mcy56D3ujX2hLBo= Received: by 10.204.51.208 with SMTP id e16mr1932329bkg.121.1311670306246; Tue, 26 Jul 2011 01:51:46 -0700 (PDT) Received: from [192.168.24.2] (91-64-205-130-dynip.superkabel.de [91.64.205.130]) by mx.google.com with ESMTPS id f27sm94475bku.34.2011.07.26.01.51.45 (version=SSLv3 cipher=OTHER); Tue, 26 Jul 2011 01:51:45 -0700 (PDT) Message-ID: <4E2E8021.3080306@googlemail.com> Date: Tue, 26 Jul 2011 10:51:45 +0200 Reply-To: sebastian.krebs.berlin@googlemail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: PHP internals list References: <4E2E784F.4050307@googlemail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Function/Constant autoloading From: sebastian.krebs.berlin@googlemail.com (Sebastian Krebs) Hi, Thanks for your reply Am 26.07.2011 10:35, schrieb Nathaniel Catchpole: > There is lazy loading for functions via apc.lazy_functions (although I've > not properly tested this yet). That doesn't require any userspace code > changes. As far as I can see this is for built-in functions only. The problem I see is, that APC cannot know, where my functions are located and therefore cannot load it without userspace help. > > For define() I'm not aware of anything allowing for lazy loading constants > (define() is just a function call). > > However there are a few approaches for avoiding define(), you could look at > apc_define_constants(), http://pecl.php.net/package/hidef and > http://pecl.php.net/package/chdb, you could also switch to class constants > and lazy load your classes. Maybe my description were a little bit misleading: I was talking about especially namespace constant like namespace my\ns; const FOO = 'BAR'; I know I can use class constants instead (as well as I can use static methods instead of functions), but that makes me feel, that functions and namespace constants are more or less useless now. > > I haven't > > > > On Tue, Jul 26, 2011 at 5:18 PM, Sebastian Krebs< > sebastian.krebs.berlin@googlemail.com> wrote: > >> Hi, >> >> Maybe this topic occured already, then sorry when I'm wasting your time, >> but I'm wondering, why there is no autoloading for functions and >> (namespace)constants. >> >> When a class is not found, then an userland function is called. Thus I >> don't see a reason, why something like this doesn't exists for functions and >> (namespace)constants too, because using them is quite uncomfortable right >> now compared to classes and the decision _how_ to load them would be on the >> developers-side anyway. >> >> Sebastian Krebs >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >