Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59418 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26256 invoked from network); 7 Apr 2012 15:22:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2012 15:22:53 -0000 Authentication-Results: pb1.pair.com header.from=jbafford@zort.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jbafford@zort.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zort.net from 96.241.205.2 cause and error) X-PHP-List-Original-Sender: jbafford@zort.net X-Host-Fingerprint: 96.241.205.2 nova.zort.net Received: from [96.241.205.2] ([96.241.205.2:49029] helo=nova.zort.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/C7-23111-CCB508F4 for ; Sat, 07 Apr 2012 11:22:53 -0400 Received: from [10.0.1.2] (pulsar.zort.net [96.241.205.6]) (authenticated bits=0) by nova.zort.net (8.14.5/8.14.4) with ESMTP id q37FMo7t015147 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Sat, 7 Apr 2012 11:22:50 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1257) In-Reply-To: Date: Sat, 7 Apr 2012 11:22:50 -0400 Content-Transfer-Encoding: quoted-printable Message-ID: References: <03FFDCA3-90B2-48CA-B102-7562E0E9CA45@zort.net> To: PHP Internals X-Mailer: Apple Mail (2.1257) Subject: Re: [PHP-DEV] PHP class files without 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 doesn't seem to have very much support. There are a variety of = other ideas that have been floating around that request changes to how = the parser handles specific code (different short tags, sandboxing, = auto-escaping, etc.). >=20 > What if you have just ONE function with a variety of options? = Something like: >=20 > execute_file('path/to/foo.php', array( > 'require'=3D>true, > 'once'=3D>true, > 'begin_code'=3D>' 'shorttags'=3D>array(''), > 'autoescape'=3D>function($str){return htmlentities($str, ENT_QUOTES = | ENT_HTML5, 'UTF-8');}, > ... > )); While there's some elegance with your execute_file (there'd definitely = be benefits to one function instead of the four we have now), the extra = options would spawn so much Daily WTF material it wouldn't be funny, and = I think most people would just stick with include/require/*_once because = there'd be a lot less effort in the common case. > This would provide a single consistent hook for any further DSL like = features without impacting the behavior of any existing code. Some other = options that might make sense: >=20 > lint (like command line) Actually, it'd be pretty cool to be able to lint a file without having = to include runkit (there is a runkit_lint($code)) or make an external = call to php -l. =20 > end_code (similar to command line, corresponds with begin_code (also = command line))=20 > args (also command line) > Any PHP_INI_ALL directives >=20 > John Crenshaw > Priacta, Inc. -John -- John Bafford http://bafford.com/