Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59503 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86839 invoked from network); 9 Apr 2012 13:40:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Apr 2012 13:40:11 -0000 Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain punkave.com designates 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:50251] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/E5-56433-9B6E28F4 for ; Mon, 09 Apr 2012 09:40:11 -0400 Received: by ggmb2 with SMTP id b2so2059283ggm.29 for ; Mon, 09 Apr 2012 06:40:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=rwV+ZdNDFEp/IW/0vlhfkhhoZ6dXe8v6miBsasvMEwc=; b=KlaP7hdweAGwAw/2VYo1esNUlW9mJokQM6izfyMAWga/dcjYgeliqMRQXY3/AkW2Wq cpEmqobw6r2eGHFNStPYysbY7VTmdeQzhoPYudLUA1/6SY1tVaFBWVRLPEmZYeqaQrYl mjkBXAdw3Ya/Tv2R2uTc6ZYjGjZdBa1vODjIoLmZfAqR9sKoHnOVzAbj1Hldl5zebxiw /LkatREF4+AEoNW+ea+YWqgOY0iCPPC7PDu2LD+qYmALEoqlI/I10uvOkgBO/1nUrOER vGmXjjBHdpU3DiO55n8cLqdN5lnBd3QN3Bg+4qcRIr0X5NpRJ2gb4v3MRlB2YxZ4UYS6 npJg== MIME-Version: 1.0 Received: by 10.236.175.164 with SMTP id z24mr6013832yhl.101.1333978807294; Mon, 09 Apr 2012 06:40:07 -0700 (PDT) Received: by 10.100.35.16 with HTTP; Mon, 9 Apr 2012 06:40:07 -0700 (PDT) In-Reply-To: <4F82E13A.7010209@developersdesk.com> References: <4F82D57F.8020101@gmail.com> <4F82E13A.7010209@developersdesk.com> Date: Mon, 9 Apr 2012 09:40:07 -0400 Message-ID: To: Rick WIdmer Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQleqSGE78+sLiZnIBrRqj3ZbzjM4PB4rCXFki6hEeJYuIU73OjLPPtDyiK7N60NMxoYKkVg Subject: Re: [PHP-DEV] Re: RFC: source files without opening tag From: tom@punkave.com (Tom Boutell) On Mon, Apr 9, 2012 at 9:16 AM, Rick WIdmer wro= te: > > Option 1: Introduce require_path > > I think require_code is a better name. =A0Parm 1 isn't a path, it is a fi= le, > so require_path seems wrong to me. Yeah, you're not the first to say this. require_file and require_code have both been suggested. I'm fine with either really. > I'd prefer a 'start in code mode' optional second parameter to > include[_once] and require[_once]. That would be fine as far as my goals here go, but I'm concerned that we'll just repeat this discussion if any other options for requiring things come into being (: > Option 2: Filename Convention > > The PHP engine should not know or care what the file extension is. =A0I w= on't > object if you can convince autoloader authors to follow the .phpc > convention. =A0Personally, once I can count on this feature, every file I > include/require will probably be written starting in code mode and using = the > new calling convention. =A0Even when I use PHP to create page templates..= . Sounds like you're basically OK with that bit. > Additional suggestions: > > Add an option so the CLI can start in code mode too. > > Add another Handler to the Apache SAPI, maybe application/x-httpd-php-cod= e > similar to x-httpd-php and x-httpd-php-source, so we can configure Apache= to > start arbitrary file extensions with code mode on. =A0This defers setting= the > action for various file extensions to the person configuring the web serv= er. > > Other web server SAPIs will need similar treatment, but I'll leave them t= o > someone with personal experience. I'm not opposed to these suggestions. I was trying to keep it conservative and simple to implement and focus on the case where it bugs me (creating libraries of class files), but I'd be happy to see a way for .phpc to be the entry point / frontend controller / standalone script as well. As you say it must be done with SAPI options (the CLI included), not hardcoded file extension checking. --=20 Tom Boutell P'unk Avenue 215 755 1330 punkave.com window.punkave.com