Looking for Code Cleanup Tool

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Looking for Code Cleanup Tool

Post 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--
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Haha...Sounds like a bit of wishful thinking...

Would like to be proven wrong though

Mark
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Post 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--
Post Reply