Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59691 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14021 invoked from network); 11 Apr 2012 00:17:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Apr 2012 00:17:46 -0000 Authentication-Results: pb1.pair.com header.from=luke@cywh.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=luke@cywh.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cywh.com from 209.85.160.42 cause and error) X-PHP-List-Original-Sender: luke@cywh.com X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:45388] helo=mail-pb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/E5-18401-6ADC48F4 for ; Tue, 10 Apr 2012 20:17:43 -0400 Received: by pbcun1 with SMTP id un1so632395pbc.29 for ; Tue, 10 Apr 2012 17:17:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=user-agent:date:subject:from:to:message-id:thread-topic:in-reply-to :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=xYu6CzbL10wpMQ7cs58cHIA0yJttHt4uZU3mNLrsyi4=; b=RM31o1SiFpIgCCEueLh19tjOz++02PP37i6zw8CZs3XWULzurrUfw3gkjC516+i7JZ U4G8BlSL/RQ2lvxtPRdkFZ7rhYmjjOsCuKkHJG5ABnY5DY6dg41sSl7lcYbE/ZmAe+Rj VScN1NzaPgvI0Dn6kYz5z19CXew0CvOnKQhZN3tAnfDi5QcccUGjyB7O7640e3OJnosS diBl632y5eA1qVNhZ+Sh9Er+jugvM1ngHpBcjrGp5B/UrltC2Ak3SQsnN3FeQ88lDExs /o0vJUDwHC/J/1etfsMQLmLVt/G4dc3wwW7VBEkuSFWlS41uoRZqoFU6qI7dcZgnxFi7 0ACg== Received: by 10.68.132.36 with SMTP id or4mr32799878pbb.115.1334103459774; Tue, 10 Apr 2012 17:17:39 -0700 (PDT) Received: from [10.1.10.222] ([66.60.139.106]) by mx.google.com with ESMTPS id e7sm1229942pbs.21.2012.04.10.17.17.37 (version=SSLv3 cipher=OTHER); Tue, 10 Apr 2012 17:17:37 -0700 (PDT) User-Agent: Microsoft-MacOutlook/14.13.0.110805 Date: Tue, 10 Apr 2012 17:19:17 -0700 To: Tom Boutell , PHP Internals Message-ID: Thread-Topic: [PHP-DEV] UPDATED RFC version 1.1: source files without opening Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Gm-Message-State: ALoCoQnIS0rzVyBsHmUDjrThHC0/2Skl0TKh+e6Jpqad+wGC4BUp9mYp8ZnJyApbZTYVWb+CcZvV Subject: Re: [PHP-DEV] UPDATED RFC version 1.1: source files without opening On 4/10/12 4:53 PM, "Tom Boutell" wrote: >Please see: > >https://wiki.php.net/rfc/source_files_without_opening_tag > >After following the discussion I have updated the RFC with the >following major changes: > >* Forbade the use of ?> entirely in "pure PHP" files (without >restricting it at all in other PHP files) > >* Replaced my original new require_path keyword with a second, >optional parameter to the standard include/require family of keywords > >* Replaced an array of options with a bitwise OR of options > >* Changed the proposed filename extension from .phpc (which apparently >is in use somewhere, maybe?) to .phpp ("php pure") Looks good, however: - 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. Example: if(class_exists("MyClass")) // Auto loader is used { // Class exists, continue normal... } else { // Class doesn't exist, do stuff... but warnings are being thrown! Eeek! } (An INCLUDE_SILENT is probably the most important to me) - The INCLUDE_ONCE and INCLUDE_ERROR_ON_FAILURE are a bit redundant. Wouldn't you just use require or include_once/require_once? - 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. - I would like to be able to specify the mode as an environmental variable from the web server, perhaps "PHP_MODE". So I could do something like this in my Nginx config: location / { fastcgi_pass unix:/Server/tmp/php-fpm.sock; include fastcgi_params; fastcgi_param PHP_MODE "pure"; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_param SCRIPT_NAME /index.php; fastcgi_param HTTP_ACCEPT_ENCODING ""; fastcgi_param HTTPS $https; } Luke