Page 1 of 1

Looking for Code Cleanup Tool

Posted: Thu Nov 20, 2003 9:38 am
by artexercise
I am looking for a tool or script or something that will clean up outdated code for version upgrading.

I have downloaded an open source project that used an old version of PHP and they continue to bomb PHP 4.3.0 by using variables that have not been set and by not putting quotes around index names outside of print statements.

Does anyone know of a tool to help with this. I've tried googling for one but I keep gong down wrong paths.

Thanks.

JOE--

Posted: Thu Nov 20, 2003 9:53 am
by twigletmac
I don't know of any tool to do this - you might be able to run a regular expression search and replace to find unquoted element attributes (the editor I use - EditPlus allows regex replaces as do others). But when it comes to unset variable warnings there's a variety of things that could cause those so you'll probably have to do a lot of the updating by hand.

Mac

Posted: Thu Nov 20, 2003 9:54 am
by JayBird
Haha...Sounds like a bit of wishful thinking...

Would like to be proven wrong though

Mark

Posted: Thu Nov 20, 2003 10:01 am
by artexercise
RegExep for unquoted index names becomes difficult because a majority of the $var[index] are inside print""; statements. When they are inside the print statement quotes are not needed around the index arrays in fact it breaks the code again.

I was thinkig it was wishful thinking as well but one can always hope.

JOE--