Jump to content

PHPWasher (cleans up your PHP code)


Vinze

Recommended Posts

Hey, I first created this just for own use, but now I released it as open source software: PHPWasher. However, it is far from perfect, and that is where I need your help.

 

PS. An online demo is coming, the link just needs to appear at the site (should be there somewhere in the next three hours).

 

Thanks in advance.

Link to comment
Share on other sites

OK, I'm a bit stumped... Just for fun, I uploaded a file that I have that has a very good layout already, just to see what it would do, and it got all screwed up. It even put line breaks and tabs in very conspicuous spots within the middle of strings. IMHO, there's a loooong way to go before I'd use it for anything. I think the idea is great, but you're also making the assumption that everyone that uses it wants their code "washed" the same way you prefer yours. I would recommend you give some options if you're going to do that... at least something that asks if they want to use spaces or tabs, 2 or 4 spaces, etc. The basic layout elements should still be left up to the user.

Link to comment
Share on other sites

OK, I'm a bit stumped... Just for fun, I uploaded a file that I have that has a very good layout already, just to see what it would do, and it got all screwed up. It even put line breaks and tabs in very conspicuous spots within the middle of strings. IMHO, there's a loooong way to go before I'd use it for anything. I think the idea is great, but you're also making the assumption that everyone that uses it wants their code "washed" the same way you prefer yours. I would recommend you give some options if you're going to do that... at least something that asks if they want to use spaces or tabs, 2 or 4 spaces, etc. The basic layout elements should still be left up to the user.

 

It already is possible to set your own indentation, however, it is not yet possible to edit options in the online demo, will add that soon.

 

It's too bad I don't know your code, otherwise I could see what went wrong and improve the PHPWasher code.

Link to comment
Share on other sites

It's too bad I don't know your code, otherwise I could see what went wrong and improve the PHPWasher code.

 

Here. I've attached the code I threw in. It's the same code I posted in the "Sudoku CSS" question earlier this morning. It really made a mess of it, but it's already formatted, so that may be the issue. It's almost like it threw in an extra line break for each line of code, too.

 

[attachment deleted by admin]

Link to comment
Share on other sites

It's too bad I don't know your code, otherwise I could see what went wrong and improve the PHPWasher code.

 

Here. I've attached the code I threw in. It's the same code I posted in the "Sudoku CSS" question earlier this morning. It really made a mess of it, but it's already formatted, so that may be the issue. It's almost like it threw in an extra line break for each line of code, too.

 

Thanks a lot, I'll be looking at it in a minute. And that is was already formatted should not post a problem as it first removes all formatting, then adds new. I'll post back here after I've looked at it :D

Link to comment
Share on other sites

It's too bad I don't know your code, otherwise I could see what went wrong and improve the PHPWasher code.

 

Here. I've attached the code I threw in. It's the same code I posted in the "Sudoku CSS" question earlier this morning. It really made a mess of it, but it's already formatted, so that may be the issue. It's almost like it threw in an extra line break for each line of code, too.

 

Thanks a lot, I'll be looking at it in a minute. And that is was already formatted should not post a problem as it first removes all formatting, then adds new. I'll post back here after I've looked at it :D

 

Right, I saw your script and it has helped me a lot. I knew it doesn't play very well with HTML (yet), but apparently it also doesn't play well with inline CSS and I forgot to add support for for() and foreach() . That really was a lot of help, thanks!

Link to comment
Share on other sites

Right, I saw your script and it has helped me a lot. I knew it doesn't play very well with HTML (yet), but apparently it also doesn't play well with inline CSS and I forgot to add support for for() and foreach() . That really was a lot of help, thanks!

 

Do you have if, elseif, else if, else, while and the myriad ways of declaring arrays built in? those are some other bracket elements I can see throwing off layouts if they're not handled properly as well.

 

Let me know when you have some of this fixed, and I'd love to see how it works then.

Link to comment
Share on other sites

Right, I saw your script and it has helped me a lot. I knew it doesn't play very well with HTML (yet), but apparently it also doesn't play well with inline CSS and I forgot to add support for for() and foreach() . That really was a lot of help, thanks!

 

Do you have if, elseif, else if, else, while and the myriad ways of declaring arrays built in? those are some other bracket elements I can see throwing off layouts if they're not handled properly as well.

 

Let me know when you have some of this fixed, and I'd love to see how it works then.

 

if, elseif, and else should work, I'll look at while too and the square-brackets methods too, and I'll be sure to let you know :D

Link to comment
Share on other sites

see my attach pic. the </html> tag isnt lined up to <html> you should probably fix that.

Ted

 

I know, HTML's still an issue... I've no solution for that problem yet, but I know how I'll be solving the regular-expression screwing, it's just that I'm busy atm ;)

Link to comment
Share on other sites

  • 2 weeks later...

I'm sorry to say, but honestly... I think it was pretty ugly.

 

It made more of a mess of my script than I already had.

 

Could you post the script you inserted?

 

I'm a bit busy at the moment, but when I have time again I'll check back to this thread and try to solve all problems.

Link to comment
Share on other sites

Can you kindly tell me how i can wash 3200 lines of code in that small box please cheers.

 

I assume you used the online version? If you did, that box is meant to upload a file that contains code, by clicking "Browse".

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.