Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40380 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89846 invoked from network); 8 Sep 2008 22:36:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2008 22:36:37 -0000 Authentication-Results: pb1.pair.com header.from=auroraeosrose@shitennou.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=auroraeosrose@shitennou.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain shitennou.com from 208.83.222.18 cause and error) X-PHP-List-Original-Sender: auroraeosrose@shitennou.com X-Host-Fingerprint: 208.83.222.18 unknown Linux 2.6 Received: from [208.83.222.18] ([208.83.222.18:52591] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/69-46475-4F8A5C84 for ; Mon, 08 Sep 2008 18:36:36 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 8029D91E131; Mon, 8 Sep 2008 15:35:50 -0700 (MST) Received: from [192.168.1.101] (24-247-219-180.dhcp.cdwr.mi.charter.com [24.247.219.180]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 08C4E91E130; Mon, 8 Sep 2008 15:35:49 -0700 (MST) Message-ID: <48C5A90E.6060902@shitennou.com> Date: Mon, 08 Sep 2008 18:37:02 -0400 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Stanislav Malyshev CC: internals@lists.php.net References: <486FA5FB.1000300@php.net> <48C55855.4080602@zend.com> <48C5624A.1040901@zend.com> <48C56743.2060706@zend.com> <48C56821.2040805@shitennou.com> <48C5695E.1010404@zend.com> <48C56A51.1000307@shitennou.com> <48C56CEE.6050807@zend.com> <48C56DED.4010407@shitennou.com> <48C57045.6020003@zend.com> <48C5715C.2070102@shitennou.com> <48C574E8.1030504@zend.com> <48C57761.5030708@shitennou.com> <48C57F58.3060703@zend.com> <48C59A7D.50201@shitennou.com> <48C5A0B9.2040300@zend.com> In-Reply-To: <48C5A0B9.2040300@zend.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] Re: towards a 5.3 release From: auroraeosrose@shitennou.com (Elizabeth M Smith) Stanislav Malyshev wrote: > Well, I can tell you what's bad for you but I can't stop you from doing > that :) use * is bad for you, but if you insist on simulating it - well, > ok, it's your code. I suspect even ZF will run into some kind of import * functionality being needed. Do you really want to tell a user they have to write 18 use statements before using say the DB component? Or for PEAR2? when a pear_import_package($packagename, $importbase); would get it all done for them? sorry but users do NOT like to type. >> Here's a quick use case for you -> you have a group of "helper >> functions" for a PHP based template system. You want to have those >> functions in "global scope" for the template (and yes, you might want to >> override strlen) and no, you don't want your templates to be using >> static calls into namespaced functions. > > I don't see in this case why: > a) tmpl::display("mywidget") or html::b("foo") is unusable as helper > functions? For me it looks even better - you can actually have > meaningful names without them looking awkward! As you said before - how is it any different from just being able to call escape("foo") or display("foo"); It's a matter of taste. To me that is not anymore of a meaningful name - just a different syntax and not one your average wordpress user would know how to handle. > b) overriding strlen makes any sense even for helpers? Just to confuse > the hell out of readers? No - imagine your app is all unicode and you want strlen to actually use an mbstring or iconv implementation - you could wrap that transparently for your template authors. > c) you don't want templates to make static calls? Sometimes security is important in templates, depending on who is creating them and how you allow users to edit them. Not all applications have the same requirements. > BTW, see how it's solved in Zend Framework - works just fine. Extremely > pluggable and doesn't require you to pollute global space. First of all, with namespaces and the ability to alias functions you wouldn't pollute the global space, you'd only push your helpers into the global space where the templates would use it. Secondly, I don't approve of the one class for every helper - feels bloated. As I said before, not all applications have the same requirements. Thanks, Elizabeth