note 27452 deleted from function.ob-get-contents by nlopess
| From: | nlopess@php.net | Date: | Sun, 25 Jan 2004 16:27:05 +0000 |
| Subject: | note 27452 deleted from function.ob-get-contents by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64158@lists.php.net to get a copy of this message | ||
Note Submitter: cdarklock@darklock.com
----
I was thinking about what good this would be myself when I first heard about it yesterday evening
(my wife came across it at work, and I've only been teaching myself PHP4 for a day or two). It
occurred to me that it would be useful for generating weekly reports:
1. A user asks for a report.
2. Your response script looks for an existing report.
3. If the report exists and is not outdated, you include the report.
4. If the report does NOT exist or IS outdated, you instead include a PHP script which captures its
output buffer and writes it to a file before flushing it. The resulting file is effectively a
"fake" script run, producing identical output without any processing.
This gives the user a timely report for whatever definition of "timely" you prefer, but
doesn't force him to wait for it to be generated every single time -- only one user in each
reporting period ever has to wait for the report to be generated. It wouldn't make much of a
difference on the average web site, but if you use PHP to generate business reports from huge
datasets (hundreds of millions of records), it could take several minutes to complete a report that
thousands of people need to see. You don't want ALL of them to wait several minutes.
Just a thought. I don't work for the phone company or the intelligence community anymore, so I
don't ever anticipate needing anything terribly complex out of a database that size.