Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59413 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18522 invoked from network); 7 Apr 2012 14:54:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2012 14:54:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=johncrenshaw@priacta.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=johncrenshaw@priacta.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain priacta.com designates 64.95.72.241 as permitted sender) X-PHP-List-Original-Sender: johncrenshaw@priacta.com X-Host-Fingerprint: 64.95.72.241 mxout.myoutlookonline.com Received: from [64.95.72.241] ([64.95.72.241:52652] helo=mxout.myoutlookonline.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/36-23111-805508F4 for ; Sat, 07 Apr 2012 10:54:01 -0400 Received: from mxout.myoutlookonline.com (localhost [127.0.0.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id 3BB6F8BD1D2; Sat, 7 Apr 2012 10:53:58 -0400 (EDT) X-Virus-Scanned: by SpamTitan at mail.lan Received: from HUB027.mail.lan (unknown [10.110.2.1]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mxout.myoutlookonline.com (Postfix) with ESMTPS id CB0018BCEB6; Sat, 7 Apr 2012 10:53:57 -0400 (EDT) Received: from MAILR001.mail.lan ([10.110.18.28]) by HUB027.mail.lan ([10.110.17.27]) with mapi; Sat, 7 Apr 2012 10:53:51 -0400 To: Tom Boutell , PHP Internals Date: Sat, 7 Apr 2012 10:53:49 -0400 Thread-Topic: [PHP-DEV] PHP class files without References: <03FFDCA3-90B2-48CA-B102-7562E0E9CA45@zort.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] PHP class files without From: Tom Boutell [mailto:tom@punkave.com]=20 > > That's a good point too. > > I think this is a better proposal: > > include_code, require_code, and require_code_once would work just like in= clude, require and require_once, except that the parser would start out in = PHP mode. > I don't like this, but it's closer. I hate the idea of adding a whole mess = of one-off functions just to support a single coding style feature that doe= sn't seem to have very much support. There are a variety of other ideas tha= t have been floating around that request changes to how the parser handles = specific code (different short tags, sandboxing, auto-escaping, etc.). What if you have just ONE function with a variety of options? Something lik= e: execute_file('path/to/foo.php', array( 'require'=3D>true, 'once'=3D>true, 'begin_code'=3D>'array(''), 'autoescape'=3D>function($str){return htmlentities($str, ENT_QUOTES | E= NT_HTML5, 'UTF-8');}, ... )); This would provide a single consistent hook for any further DSL like featur= es without impacting the behavior of any existing code. Some other options = that might make sense: lint (like command line) end_code (similar to command line, corresponds with begin_code (also comman= d line))=20 args (also command line) Any PHP_INI_ALL directives John Crenshaw Priacta, Inc.