Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beautify does not work with PHP and that is fine... but read this. #688

Closed
CodeAmend opened this issue May 7, 2015 · 13 comments
Closed

Comments

@CodeAmend
Copy link

So Beautify does not support php. That is ok.
So can you please not mess with code in php tags?

What happens: It scrunches all PHP code together and adds spaces after $ !!!

Way to fix it: Just have Beautify NOT touch code in between the tags.

I think this would solve a lot of my headache at least.

@bitwiseman
Copy link
Member

What you are requesting should already be there.

Please give an example input, actually output, and desired output.
Also, where did your run this? Was it on the web or from the command-line? If command-line what command did you run?

@bitwiseman
Copy link
Member

@CodeAmend ? I'd like to help you here. A little more info needed.

@T3chArmy
Copy link

T3chArmy commented Jun 3, 2015

@bitwiseman I can give you an example when I get home from work today, but generally what happens is something like what this comment is: brackets-beautify/brackets-beautify#142 (comment)

@CodeAmend
Copy link
Author

I recently switched 100% linux and I cannot get the same results as
windows. Let me work with it a bit more and see if I can prove what I am
talking about. Or better yet, its a non-issue now.

thank you.

On Wed, Jun 3, 2015 at 12:42 PM, T3charmy notifications@github.com wrote:

@bitwiseman https://github.com/bitwiseman I can give you an example
when I get home from work today, but generally what happens is: something
like what this comment is: brackets-beautify/brackets-beautify#142 (comment)
brackets-beautify/brackets-beautify#142 (comment)


Reply to this email directly or view it on GitHub
#688 (comment)
.

@T3chArmy
Copy link

T3chArmy commented Jun 3, 2015

Well, regardless, I(plus a bunch of others) are still having this issue. it usually has to do with the $ becoming separated from the variable, or the extra space inside an array variable($example["one "])

Edit: another thing it messes up is it puts all of the PHP code on 1 line, which can mess up things like

# this may not be what I'm thinking. I'll double check
# if this is something that gets messed up in about 3 hours.
if($animal == "cat") 
    echo "meow";

@askmrsinh
Copy link

yes, one can just leave out the <?php.....?> portion but what if the document is long and it alternates between PHP and HTML; it would be a tedious task.

@T3chArmy
Copy link

T3chArmy commented Jun 4, 2015

@user501254 I'm for all optimizing the PHP code, in fact. it'd be really awesome if it could. Just as it sits right now, it will break most code you throw at it, which isn't really ideal. numerous times I've had to go back and correct files that have gotten messed up when beautifying, eventually I just stopped using it. I was spending more time correcting than it would have taken me to beautify it myself.

@bitwiseman
Copy link
Member

This is definitely a bug. We shouldn't break things if we can avoid it.

@bitwiseman bitwiseman added this to the v1.6.0 milestone Jun 4, 2015
@T3chArmy
Copy link

T3chArmy commented Jun 4, 2015

another big thing this screws up, is since it puts all of the PHP on one line it would make something like:

<?php
for($i = 1; $i <= 100; $i++;) {
    #count to 100!
    echo($i . "</br>");
}
?>

the beautify would cause that code to turn into

<?php for($i=1 ; $i <=1 00; $i++;) { #count to 100! echo($i . "</br>"); } ?>

which due to the comment, everything after the # gets ignored, there for breaking scripts.

also note the extra/incorrect spaces on $i ; and the <=1 00

@CodeAmend
Copy link
Author

This is SO annoying it is making Beautify useless. Please just ignore all php code. PLEASE!

I spent the last few days trying to figure out what was going on in my code!!! Turns out I had beautify on save turned on!!! I disabled it a while back, and for some reason it was on again. I just never expected this.

Just one small example of the HUNDREDS of problems it caused.
before Beautify.
define('DB_PASSWORD', 'dbwjaMbK3TUNC4BP');

After Beautify
define('DB_PASSWORD ', 'dbwjaMbK3TUNC4BP '); <--- space!!! why?

I never spotted it for 2 days! It costs me valuable working time.

Unfortuantely, I am going to uninstall. If there is a way to give a low score, It is going to have to take a hit because of the php issues it is causing!

Just ignore the php code!

Also look at T3charmy example above. It does that also. This plugin just ruins php!

@bitwiseman bitwiseman removed this from the v1.6.0 milestone Jun 16, 2015
@bitwiseman
Copy link
Member

Closing as duplicate of #490. This is getting fixed under that issue.

@freshdesignza
Copy link

This just ruined thousands of lines of my code. Boooooo.

@Wendihihi
Copy link

@freshdesignza You didn't make a backup huh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants