Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59699 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31341 invoked from network); 11 Apr 2012 01:58:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Apr 2012 01:58:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain punkave.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:55745] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 65/49-18401-855E48F4 for ; Tue, 10 Apr 2012 21:58:48 -0400 Received: by yenl5 with SMTP id l5so297909yen.29 for ; Tue, 10 Apr 2012 18:58:45 -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:cc :content-type:content-transfer-encoding:x-gm-message-state; bh=vguAm5zFoliiozk+Gj3BpgImvyiMsrRs0HM73JWU6is=; b=e7yHl9SdP26tK8s60k+kJccdgwGVBl6cUmk5E9nhcubxFEIkqmwc2lRI5FFTNJla43 N5rPg9jJ5ec/czgFAQ0exul+d92MPGIqmr9QJG5F9jws/yJd3lSkAlMJ9t+PY2QwHv5v cKgDUCsOGOHj9aY7U4IcP/nR6kf3LQaNIQZC7qcvukm8kZXJex9EFtMfBfIiTqT2n1mM IX1hy+zK4pCKavBoQbFzTxC4LYjt/Q67ISr5U1sdFG6LyKZim+bxWqQvORkHHDHvQ4M1 M+jZlW0h9zU9UCyfuB7xGKNalQoJjD54rixZw4INyS+fTW6bpVZiMBfv09tJtn2Scs1o ncxw== MIME-Version: 1.0 Received: by 10.236.184.229 with SMTP id s65mr10848720yhm.102.1334109525552; Tue, 10 Apr 2012 18:58:45 -0700 (PDT) Received: by 10.100.35.16 with HTTP; Tue, 10 Apr 2012 18:58:45 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 Apr 2012 21:58:45 -0400 Message-ID: Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQm9x0WPwQRpoy2Q5lYNYCguZ2KoL+TnLaBA/xs0UEGDNuCJ14dWzOiCJmZVSYdepOB26R5P Subject: Re: [PHP-DEV] UPDATED RFC version 1.1: source files without opening wrote: > - I would like to see an INCLUDE_SILENT method to prevent warnings from > being thrown with include/include_once statements. Currently doing > something like @include "/path/to/file.php"; not only hides these > warnings, but warnings/errors/notices thrown by the file itself. An > INCLUDE_SILENT flag would be extremely helpful in some situations. I almost included this, but wasn't sure how you would actually become aware of the error at that point. class_exists is probably a valid answer to that. It would be dangerous to use the INCLUDE_SILENT for any include file that wasn't a class. The return value of 'include' is the return value of the code it executed, so we can't use that. How about INCLUDE_EXCEPTION? This is really a separate issue, but it's true it would make a lot of sense to add this bit at the same time. > - The INCLUDE_ONCE and INCLUDE_ERROR_ON_FAILURE are a bit redundant. > Wouldn't you just use require or include_once/require_once? I like being able to do things dynamically without writing a switch statement. As we move toward having more bit flags, why not have the option of using flags for the existing distinctions as well (as long as you start with plain old 'include')? > - Not sure I like the word "pure code". I would prefer just "code" - > INCLUDE_CODE. Perhaps even just "pure" - INCLUDE_PURE. I just don't like > two words. Would also like another flag for the other mode, such as > INCLUDE_TEMPLATE or INCLUDE_EMBED. These are bits, so INCLUDE_TEMPLATE would just be zero. Not sure it makes sense to have that as an explicit flag. > - I would like to be able to specify the mode as an environmental variabl= e > from the web server, perhaps "PHP_MODE". So I could do something like thi= s > in my Nginx config: > > location / { > =A0 =A0fastcgi_pass =A0 unix:/Server/tmp/php-fpm.sock; > =A0 =A0include =A0 =A0 =A0 =A0fastcgi_params; > =A0 =A0fastcgi_param PHP_MODE "pure"; > =A0 =A0fastcgi_param =A0SCRIPT_FILENAME =A0 =A0 =A0$document_root/index.p= hp; > =A0 =A0fastcgi_param =A0SCRIPT_NAME =A0 =A0 =A0 =A0 =A0/index.php; > =A0 =A0fastcgi_param =A0HTTP_ACCEPT_ENCODING ""; > =A0 =A0fastcgi_param =A0HTTPS $https; > =A0 =A0 =A0 =A0} I almost included this too but I am a little fatigued thinking about all the details (: Can we arrange it so that .php and .phpp each do the right thing under fastcgi without creating two process pools? Is configuring FPM similar to configuring the classic CGI SAPI for FastCGI operation? A -p option for CLI and plain CGI is simple enough at least. I personally don't mind all that much if entry point PHP files don't get this feature but of course I see that others would like it. And one day it would be nice to alias phpp to php -p and write PHP one-off scripts without