Skip to main content
Inspiring
March 1, 2018
Answered

Applying source formatting inserts bugs in php code.

  • March 1, 2018
  • 3 replies
  • 3591 views

Any way to stop Dreamweaver from formatting PHP code or train it to do it correctly?

When I format my php code it adds spaces in places there should be none, thereby introducing bugs into my code.

For example, line one is how the code should look, line 2 is how it looks after source formatting. Line 2 now inserts spaces before and after so it no longer works.

1 echo "${'Neighborhood'.$x}"

2 echo " ${ 'Neighborhood'.$x} "

Any solutions for this? It makes source formatting extremely dangerous as it introduces a lot of bugs into code.

This topic has been closed for replies.
Correct answer Kratika Agarwal

Thanks, it seems interesting (RapidPHP) but unfortunately is available only for Windows (I'm a Mac user).


Hi All,

We are happy to inform you we have addressed a couple of PHP source formatting issues in our latest pre release drop 15073.

Please give it a try and share your feedback.

Let us know if it fixes your issues.

Please find the pre release invite link Adobe Prerelease

Thanks

Dreamweaver Team

3 replies

Inspiring
November 14, 2018

HI,

I'm curious if there has been any improvement on the "bugs" that "apply source formatting" introduces to php code?

In the meantime anyone know of any workarounds for this (like other methods / Mac apps etc)

Impressive_play01AC
Inspiring
November 14, 2018

No, absolutely no progress.

Adobe usually release only two updates yearly (March and June/July) before of the major upgrade (that correspond autumn of each year, Adobe Max), so we need to wait a lot of time (always that they are working about it).

The only workaround for me is to switch to the previous version 2015 (the last stable version of Dreamweaver).

Legend
November 14, 2018

I have a copy of RapidPHP which I use along with Dreamweaver, its lightweight and has good options for formatting PHP files, also has additional plug-ins for removing empty lines, converting double empty lines to single lines, removing trailing white space etc.

Paul-M - Community Expert
Legend
March 29, 2018

Is this any closer to being fixed? The formatting option in DW CC 2018 is capable of causing mild inconvenience to completely messing up PHP code, its adding non-breaking spaces and line breaks where it shouldn't, the latter completely breaking code.

Can someone confirm what version of DW you need to roll-back to get an Apply Source Formatting Tool that doesn't screw up PHP code? Does it need to go back to CC 2015 before Brackets was shoe-horned in?

I tested in DW CC 2018 - v18.1 (10155 build), I noticed original poster was using build 10136 , so it seems nothing has been done to date and I don't think the Dreamweaver team think PHP code is important anymore?

Paul-M - Community Expert
Impressive_play01AC
Inspiring
March 29, 2018

Energize  ha scritto

Is this any closer to being fixed?

No, it hasn't been fixed yet.

The last build "production-ready" of Dreamweaver is the CC 2015.2 (where you can use in "safety" Apply Source Formatting Tool with php pages).

Legend
March 29, 2018

BIt of a joke the whole Brackets into Dreamweaver nonsense, we're basicaly relying on third parties and the brackets community to help Adobe fix problems whatt is supposed to be a commecrcial software product.....

Paul-M - Community Expert
Nancy OShea
Community Expert
Community Expert
March 1, 2018

Which version of DW?

Which operating system?

Nancy O'Shea— Product User & Community Expert
Inspiring
March 1, 2018

Dreamweaver CC 18.0, 10136 Build. I just upgraded yesterday thinking that might help.

Windows 10

Nancy OShea
Community Expert
Community Expert
March 1, 2018

I can't reproduce it with CC 2018 on Windows 10.    That said, I'm not happy with auto code formatting in 2018 for other reasons but adding spaces to PHP code isn't one of them.  

Double check your Preferences > Code Format > Tab libraries  > PHP

Nancy

Nancy O'Shea— Product User & Community Expert