Better way ?

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

    Better way ?

    All,
    I work on my site on my local machine, which when saved, it is synced to the
    live web server. I don't have a "temp" site in between. All my edits are
    basically live. Sometimes I want to echo stuff to the screen so I can see
    what's there, etc. but I don't want anyone else during my testing to see it.
    This is what I came up with:

    function debug($debugvar ) {
    $ip = $_SERVER["REMOTE_ADD R"];
    if($ip == "10.1.1.1")
    {
    echo $debugvar;
    }
    }

    then whereever I need to see something, I call this:
    instead of echo $secvalue; I would use debug($secvalue );

    without setting up a testing site, is this the best way to approach this ?
    Thanks.


  • Chung Leong

    #2
    Re: Better way ?

    "StinkFinge r" <stinky@pinky.c om> wrote in message
    news:107ggq0iup nmkca@corp.supe rnews.com...[color=blue]
    > All,
    > I work on my site on my local machine, which when saved, it is synced to[/color]
    the[color=blue]
    > live web server. I don't have a "temp" site in between. All my edits are
    > basically live. Sometimes I want to echo stuff to the screen so I can see
    > what's there, etc. but I don't want anyone else during my testing to see[/color]
    it.[color=blue]
    > This is what I came up with:
    >
    > function debug($debugvar ) {
    > $ip = $_SERVER["REMOTE_ADD R"];
    > if($ip == "10.1.1.1")
    > {
    > echo $debugvar;
    > }
    > }
    >
    > then whereever I need to see something, I call this:
    > instead of echo $secvalue; I would use debug($secvalue );
    >
    > without setting up a testing site, is this the best way to approach this ?
    > Thanks.[/color]

    Don't do the automatic sync.


    Comment

    • Nikolai Chuvakhin

      #3
      Re: Better way ?

      "StinkFinge r" <stinky@pinky.c om> wrote in message
      news:<107ggq0iu pnmkca@corp.sup ernews.com>...[color=blue]
      >
      > I work on my site on my local machine, which when saved, it is synced
      > to the live web server. I don't have a "temp" site in between.[/color]

      So why can't you test on your local machine?
      [color=blue]
      > All my edits are basically live.[/color]

      Which is basically a bad idea.
      [color=blue]
      > Sometimes I want to echo stuff to the screen so I can see what's there,
      > etc. but I don't want anyone else during my testing to see it.
      >
      > without setting up a testing site, is this the best way to approach this ?[/color]

      Enable debugging on the remote server and use a professional IDE
      (Zend Studio or NuSphere PHPEdit). This way, you can debug without
      ever outputting anything on screen.

      Cheers,
      NC

      Comment

      • JVlad

        #4
        Re: Better way ?

        > Enable debugging on the remote server and use a professional IDE[color=blue]
        > (Zend Studio or NuSphere PHPEdit). This way, you can debug without
        > ever outputting anything on screen.[/color]

        First of all NuSphere's product is known as PHPED, not PHPEDIT :)
        All the rest is truth. With a professional debugger like DBG you can
        debug even your live site without any risk. In this order, you can run
        debug sessions through SSH tunnel and therefore avoid any chance to be
        "compromise d". At least unless SSHD is compromised too...
        DBG and PHPED HOWTOs are available there:


        -JV.

        Comment

        Working...