Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10671

Re: calling a value into another php script...

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: calling a value into another php script...
Date 2013-08-30 20:57 -0400
Organization A noiseless patient Spider
Message-ID <kvrf0r$lmf$1@dont-email.me> (permalink)
References (4 earlier) <kvq4ca$f0a$1@dont-email.me> <kvqa9h$j2n$1@dont-email.me> <kvqegc$6n2$1@dont-email.me> <52211a5e$0$6628$9b4e6d93@newsspool2.arcor-online.net> <kvrdkk$h1t$1@dont-email.me>

Show all headers | View raw


On 8/30/2013 8:33 PM, Jerry Stuckle wrote:
> On 8/30/2013 6:19 PM, Christoph Michael Becker wrote:
>> Jerry Stuckle wrote:
>>
>>> On 8/30/2013 10:30 AM, Denis McMahon wrote:
>>>> On Fri, 30 Aug 2013 08:49:14 -0400, Jerry Stuckle wrote:
>>>>
>>>>> On 8/30/2013 5:57 AM, Thomas 'The PointedEars Twat' Lahn wrote:
>>                                                    ^^^^ IMO that's
>> neither helpful nor funny.
>>
>
> Not my posting.  Please learn to reply to the appropriate person when
> commenting posts.
>
> BTW - I don't think it was meant to be either helpful or funny - but it
> is accurate.
>
>>>>>> Like actually recommending to *disable* output buffering on a
>>>>>> production site, when having output buffering *enabled* is *the*
>>>>>> *proven*, simple measure to make a PHP-powered site faster, thus more
>>>>>> user-friendly.
>>>>
>>>> The only benefit I've ever seen from PHP output buffering is it allows
>>>> you to output a page and then change the headers at the end if for some
>>>> reason you have a need to ... as long as the buffer was big enough to
>>>> hold the whole page, otherwise you're fucked anyway, which is probably
>>>> why sensible coders always make sure they send all the headers *before*
>>>> sending the output.
>>>>
>>>
>>> I've also used it when calling code which outputs directly, so I can
>>> parse that output.  For instance, if you want to know the current
>>> configuration, you can buffer the output of phpinfo(INFO_CONFIGURATION),
>>> then parse it.  It's easier to do than to figure out all of the
>>> configuration parameters yourself.  Of course, if you only want one or
>>> two, then just using ini_get() would be easier.
>>>
>>> But you're right - it's always best to just send the correct headers
>>> first, then output your data.
>>>
>>>> Anyway, as you say, the browser is probably buffering the page,
>>>> especially if it's using compression, so all that buffering in php will
>>>> do is increase the memory footprint of the process.
>>
>> What the browser does is completely unrelated to the issue at
>> hand--we're talking about the server side.
>>
>> Setting output_buffering=4096 will indeed increase the memory footprint
>> of the process--by 4 KByte!  That seems to be an awful lot these days. ;)
>>
>
> Which is completely immaterial because that's not the buffering we are
> discussing.
>
>>> Yes, the browser buffers the output - but PHP also buffers the output
>>> before sending it to the web server for efficiency.
>>
>> That depends on the ini setting of output_buffering--exactly what's the
>> issue at hand.
>>
>
> No, please read again - and understand what Pointed Head claimed.  It
> has absolutely nothing to do with the ini setting of output_buffering.
>
>>>                                                       Buffering it
>>> yourself has no gain.  And the web server will buffer the output so it
>>> can break it into the appropriate sized packets.  Buffering it yourself
>>> just adds an extra layer of overhead - the PHP buffer size doesn't
>>> change, so you will end up with the same number of buffer fills and
>>> sends to the server, and the packet size doesn't change so the same
>>> number of packets will be sent.
>>
>> What you're talking about here seems to be the usage of the ob_*() set
>> of functions.  Indeed, using these might not be the best idea,
>> *generally*.
>>
>
> Exactly - which is what Pointed Head was proposing.
>
> Please try to understand what is being said before contradicting it.
>

My apologies - I read back through this thread and realized you don't 
have the background of the previous discussions Pointed Head is talking 
about.

He has propounded that buffering in the script (generally using the 
ob_xxx() calls) is more efficient than outputting the data directly.

It has nothing to do with the PHP buffering, which I agree is handled 
well (like I said in my first response to him).

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

calling a value into another php script... nag <visitnag@gmail.com> - 2013-08-28 18:35 -0700
  Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-28 22:56 -0400
    Re: calling a value into another php script... nag <visitnag@gmail.com> - 2013-08-29 06:06 -0700
      Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-29 09:31 -0400
      Re: calling a value into another php script... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-29 17:35 +0200
  Re: calling a value into another php script... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-29 11:40 +0200
  Re: calling a value into another php script... Twayne <nobody@spamcop.net> - 2013-08-29 20:18 -0400
    Re: calling a value into another php script... Christoph Michael Becker <cmbecker69@arcor.de> - 2013-08-30 02:57 +0200
      Re: calling a value into another php script... The Natural Philosopher <tnp@invalid.invalid> - 2013-08-30 02:54 +0100
        Re: calling a value into another php script... Twayne <nobody@spamcop.net> - 2013-08-30 17:15 -0400
      Re: calling a value into another php script... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-30 11:57 +0200
        Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-30 08:49 -0400
          Re: calling a value into another php script... Denis McMahon <denismfmcmahon@gmail.com> - 2013-08-30 14:30 +0000
            Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-30 11:42 -0400
              Re: calling a value into another php script... Christoph Michael Becker <cmbecker69@arcor.de> - 2013-08-31 00:19 +0200
                Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-30 20:33 -0400
                Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-30 20:57 -0400
                Re: calling a value into another php script... Christoph Michael Becker <cmbecker69@arcor.de> - 2013-09-01 20:23 +0200
                Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-09-01 15:09 -0400
                Re: calling a value into another php script... Denis McMahon <denismfmcmahon@gmail.com> - 2013-08-31 01:28 +0000
                Re: calling a value into another php script... The Natural Philosopher <tnp@invalid.invalid> - 2013-08-31 03:55 +0100
                Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-30 23:02 -0400
        Re: calling a value into another php script... Christoph Michael Becker <cmbecker69@arcor.de> - 2013-08-31 00:10 +0200
          Re: calling a value into another php script... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-31 01:06 +0200
            Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-30 20:39 -0400
            Re: calling a value into another php script... Christoph Michael Becker <cmbecker69@arcor.de> - 2013-09-01 20:10 +0200
              Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-09-01 15:19 -0400
            Re: calling a value into another php script... Twayne <nobody@spamcop.net> - 2013-09-02 15:13 -0400
          Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-30 20:37 -0400
    Re: calling a value into another php script... The Natural Philosopher <tnp@invalid.invalid> - 2013-08-30 02:50 +0100
      Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-29 22:18 -0400
      Re: calling a value into another php script... Twayne <nobody@spamcop.net> - 2013-08-30 17:24 -0400
        Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-30 20:41 -0400
    Re: calling a value into another php script... Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-29 21:50 -0400
  Re: calling a value into another php script... Norman Peelman <npeelman@cfl.rr.com> - 2013-08-31 07:00 -0400

csiph-web