Adding a statement to all pages ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dada

    #1

    Adding a statement to all pages ?

    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
  • Joel Farris

    #2
    Re: Adding a statement to all pages ?

    dada wrote:[color=blue]
    > 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[/color]


    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!)

    Comment

    • Markus Ernst

      #3
      Re: Adding a statement to all pages ?

      "dada" <usenetdada@yah oo.com> schrieb im Newsbeitrag
      news:f7851403.0 404051913.57618 b6f@posting.goo gle.com...[color=blue]
      > 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[/color]
      delay[color=blue]
      > to all pages[/color]

      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


      Comment

      • Andy Jeffries

        #4
        Re: Adding a statement to all pages ?

        Markus Ernst wrote:[color=blue]
        > "dada" <usenetdada@yah oo.com> schrieb im Newsbeitrag
        > news:f7851403.0 404051913.57618 b6f@posting.goo gle.com...
        >[color=green]
        >>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[/color]
        >
        > delay
        >[color=green]
        >>to all pages[/color]
        >
        >
        > 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.[/color]

        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

        Comment

        • Chung Leong

          #5
          Re: Adding a statement to all pages ?

          "Joel Farris" <this.is.not@va lid.address> wrote in message
          news:f8idnbyFfu 2Ixu_dRVn_iw@co mcast.com...[color=blue]
          > 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.[/color]

          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.


          Comment

          Working...