Vinze Posted March 1, 2007 Share Posted March 1, 2007 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 https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/ Share on other sites More sharing options...
Lumio Posted March 1, 2007 Share Posted March 1, 2007 I don't know what you mean with wash? It doesn't do that much. Can you give a short description? Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-196916 Share on other sites More sharing options...
Vinze Posted March 1, 2007 Author Share Posted March 1, 2007 Basically, it indents your code for you Btw, if anybody used the downloaded version and want some features added, be sure to request them Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-196924 Share on other sites More sharing options...
obsidian Posted March 1, 2007 Share Posted March 1, 2007 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 https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-196948 Share on other sites More sharing options...
Vinze Posted March 1, 2007 Author Share Posted March 1, 2007 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 https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-196952 Share on other sites More sharing options...
obsidian Posted March 1, 2007 Share Posted March 1, 2007 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 https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-196964 Share on other sites More sharing options...
Vinze Posted March 1, 2007 Author Share Posted March 1, 2007 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 Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-196969 Share on other sites More sharing options...
Vinze Posted March 1, 2007 Author Share Posted March 1, 2007 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 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 https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-197020 Share on other sites More sharing options...
obsidian Posted March 1, 2007 Share Posted March 1, 2007 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 https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-197054 Share on other sites More sharing options...
Vinze Posted March 1, 2007 Author Share Posted March 1, 2007 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 Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-197059 Share on other sites More sharing options...
ted_chou12 Posted March 1, 2007 Share Posted March 1, 2007 see my attach pic. the </html> tag isnt lined up to <html> you should probably fix that. Ted [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-197101 Share on other sites More sharing options...
Lumio Posted March 1, 2007 Share Posted March 1, 2007 I tried it with a file that contains only PHP-Code. It worked nearly without problems. So far... nice I think if that tool gets better, I'll use it too. Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-197232 Share on other sites More sharing options...
AXiSS Posted March 2, 2007 Share Posted March 2, 2007 Pretty much screwed up my code. The PHP was fine except a {4,} in an eregi(), which it formatted as if it was an if() statement. But it pretty much killed the html. Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-197483 Share on other sites More sharing options...
Vinze Posted March 2, 2007 Author Share Posted March 2, 2007 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 https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-197843 Share on other sites More sharing options...
mattd8752 Posted March 14, 2007 Share Posted March 14, 2007 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. Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-206764 Share on other sites More sharing options...
Vinze Posted March 14, 2007 Author Share Posted March 14, 2007 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 https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-206888 Share on other sites More sharing options...
Lumio Posted March 14, 2007 Share Posted March 14, 2007 Vinze... make a RegEx request and filter PHP-Code. Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-207023 Share on other sites More sharing options...
Vinze Posted March 14, 2007 Author Share Posted March 14, 2007 Vinze... make a RegEx request and filter PHP-Code. Huh? Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-207160 Share on other sites More sharing options...
Lumio Posted March 14, 2007 Share Posted March 14, 2007 http://www.phpfreaks.com/forums/index.php/topic,129235.msg541940.html#msg541940 Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-207253 Share on other sites More sharing options...
Vinze Posted March 15, 2007 Author Share Posted March 15, 2007 http://www.phpfreaks.com/forums/index.php/topic,129235.msg541940.html#msg541940 Ah, thanks, I'll be able to use that. Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-207902 Share on other sites More sharing options...
s0c0 Posted March 15, 2007 Share Posted March 15, 2007 Will the washer wash itself? Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-208054 Share on other sites More sharing options...
Vinze Posted March 15, 2007 Author Share Posted March 15, 2007 Will the washer wash itself? Nope. I was thinking of making that possible, but I figured it'd be too much trouble without any use. Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-208075 Share on other sites More sharing options...
redarrow Posted March 21, 2007 Share Posted March 21, 2007 Can you kindly tell me how i can wash 3200 lines of code in that small box please cheers. Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-212382 Share on other sites More sharing options...
obsidian Posted March 21, 2007 Share Posted March 21, 2007 Can you kindly tell me how i can wash 3200 lines of code in that small box please cheers. Kindly tell me why you've got 3200 lines of code in one file Link to comment https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-212423 Share on other sites More sharing options...
Vinze Posted March 22, 2007 Author Share Posted March 22, 2007 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 https://forums.phpfreaks.com/topic/40676-phpwasher-cleans-up-your-php-code/#findComment-212688 Share on other sites More sharing options...
Recommended Posts