By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,748 Members | 1,570 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,748 IT Pros & Developers. It's quick & easy.

Adding a statement to all pages ?

P: n/a
I have many php files and I would like to simulate
low speed connectivity by adding sleep(5); statement to
all the php pages.
Instead of adding this statement manually to all the php files
is there a way to globally give this statement or any other way to add delay
to all pages
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
dada wrote:
I have many php files and I would like to simulate
low speed connectivity by adding sleep(5); statement to
all the php pages.
Instead of adding this statement manually to all the php files
is there a way to globally give this statement or any other way to add delay
to all pages

Umm, instead of trying to modify all your pages, why not just sign up for
one of those free internet dialup accounts? Or, at the very least, a $4.95
a month deal just for testing purposes. Then you could see what your sites
look like to a dialup user. I have both dialup and broadband, and it's
been a very good thing.
--
Joel Farris | Q: It reverses the logical flow of conversation.
twinkledust Designs | A: Why is top posting frowned upon?
http://twinkledust.com |
AIM chat: FarrisJoel |
| (this fifth line in my sig angers the net kops!)

Jul 17 '05 #2

P: n/a
"dada" <us********@yahoo.com> schrieb im Newsbeitrag
news:f7**************************@posting.google.c om...
I have many php files and I would like to simulate
low speed connectivity by adding sleep(5); statement to
all the php pages.
Instead of adding this statement manually to all the php files
is there a way to globally give this statement or any other way to add delay to all pages


Make it your use to create a head.php file where you write all informations
that are needed on all pages, as db connection, error reporting, functions
you need and so on. Include that file at the top of every page regardless of
if it's really needed. So you always have the possibility to add something
like what you want and remove it again globally for the whole application.

HTH
Markus
Jul 17 '05 #3

P: n/a
Markus Ernst wrote:
"dada" <us********@yahoo.com> schrieb im Newsbeitrag
news:f7**************************@posting.google.c om...
I have many php files and I would like to simulate
low speed connectivity by adding sleep(5); statement to
all the php pages.
Instead of adding this statement manually to all the php files
is there a way to globally give this statement or any other way to add


delay
to all pages

Make it your use to create a head.php file where you write all informations
that are needed on all pages, as db connection, error reporting, functions
you need and so on. Include that file at the top of every page regardless of
if it's really needed. So you always have the possibility to add something
like what you want and remove it again globally for the whole application.


Or even better, if you're using apache put the following in your virtual
host setting:

php_value auto_prepend /var/www/.../global.php

That way it will be prepended to every page automatically.

Cheers,
Andy
Jul 17 '05 #4

P: n/a
"Joel Farris" <th*********@valid.address> wrote in message
news:f8********************@comcast.com...
Umm, instead of trying to modify all your pages, why not just sign up for
one of those free internet dialup accounts? Or, at the very least, a $4.95
a month deal just for testing purposes. Then you could see what your sites
look like to a dialup user. I have both dialup and broadband, and it's
been a very good thing.


Well, usually your development environment is not internet accessible.
Personally I use a null modem cable, which does a reasonable job simulating
a modem connection. You'd need a second computer for that of course.

The easiest way to do this kind of testing is probably through a bandwidth
throttling proxy. The best one I've seen is Proxy Workbench
(http://www.tcpiq.com/tcpiq/pwb/info.asp). It intercepts Internet traffic at
a lower level so you don't need to fiddle with your browser's proxy
settings. Highly recommended.
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.