Minimum source version checker

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stephan van Loendersloot

    Minimum source version checker

    Hi everyone,

    I get to to see a lot of code that doesn't work on older versions of PHP
    and it can be really time consuming to write work-arounds for the latest
    functions.

    So...I was wondering if some sort of source version checker exists that
    can parse those scripts and tell me the minimum required version of PHP
    to run them.

    I apologize if this question has been asked a thousand times before, but
    my friend Google doesn't seem to be very helpful in providing an answer.

    Thanks for your time.

    --Stephan.

  • websafe

    #2
    Re: Minimum source version checker

    Stephan van Loendersloot <whistleNOSPAM@ worldonline.nl> wrote:[color=blue]
    > I get to to see a lot of code that doesn't work on older versions of PHP
    > and it can be really time consuming to write work-arounds for the latest
    > functions.
    > So...I was wondering if some sort of source version checker exists that
    > can parse those scripts and tell me the minimum required version of PHP
    > to run them.
    > I apologize if this question has been asked a thousand times before, but
    > my friend Google doesn't seem to be very helpful in providing an answer.[/color]

    Try this: http://pl2.php.net/register_globals

    --

    Comment

    • CountScubula

      #3
      Re: Minimum source version checker

      Stephan van Loendersloot <whistleNOSPAM@ worldonline.nl> wrote in message news:<bscv4n$1q u$1@news1.tilbu 1.nb.home.nl>.. .[color=blue]
      > Hi everyone,
      >
      > I get to to see a lot of code that doesn't work on older versions of PHP
      > and it can be really time consuming to write work-arounds for the latest
      > functions.
      >
      > So...I was wondering if some sort of source version checker exists that
      > can parse those scripts and tell me the minimum required version of PHP
      > to run them.
      >
      > I apologize if this question has been asked a thousand times before, but
      > my friend Google doesn't seem to be very helpful in providing an answer.
      >
      > Thanks for your time.
      >
      > --Stephan.[/color]


      Hmm, I kinda know what you mean, I have had scripts break here and
      there, on the same version of PHP, it then becomes an issue of
      compile.

      What you can do is make a note of some of the commands you are using,
      and what modules they need.

      then, with <?php phpinfo() ?> php will spit out its compile config.

      with that you should see if you have the mods you require.

      or worse, build a big function file with work arounds buit in, and
      wrappers for your functions. :(

      example, I use imagecopyresamp led, and some compiles dont have it so i
      have to use imagecopyresize . well I have all my little favorite image
      functions in a file, and wrap them with a new name:

      example:

      function imgCopyNewSize( $a,$b,$c,etc... )
      {
      if (supports resample)
      {
      imagecopyresamp led($a,$b,etc.. .)
      }
      else
      {
      imagecopyresize d($a,$b,etc...)
      }
      }





      Mike Bradley
      http://gzen.myhq.info -- free online php tools

      Comment

      Working...