Stephan van Loendersloot <wh***********@worldonline.nl> wrote in message news:<bs**********@news1.tilbu1.nb.home.nl>...
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.
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 imagecopyresampled, 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)
{
imagecopyresampled($a,$b,etc...)
}
else
{
imagecopyresized($a,$b,etc...)
}
}
Mike Bradley
http://gzen.myhq.info -- free online php tools