NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
searching for files that have a blank line at the end
Veteran

Joined: 15 Nov 2003
Posts: 118
Reply with quote
I recently spend a while trying to find an issue where one of my PHP inc files had a space at the end of the file, after the closing ?> tag, causing the space to be outputted to the browser :-/

Is there an easy way to search for files that have blank lines or spaces or tabs etc after the closing ?> tag?
View user's profileFind all posts by joebSend private message


Joined: 11 May 2008
Posts: 78
Reply with quote
Stop closing your pure PHP files with the closing php tag ?> in the first place. I had the same issue, caused by an earlier version of phped. The IDE was puting spaces at the end of some php files just by opening them and caused errors in the applications. The only thing that worked, was to stop closing with ?>. I spent quite a while until I found the culprit.
It is perfectly valid.

You could search for files, and use regular expressions like: \?>\s+$ or something.
View user's profileFind all posts by tedychSend private message
Veteran

Joined: 15 Nov 2003
Posts: 118
Reply with quote
Thanks for the response. I am 99.9% sure it was PHPed that did this to several of my files as this project has been fine for years, then all of a sudden i open it up in phpED V8 and it breaks.
It was probably done during a replace in files, or a "rename variable". The 2 functions of any editor that i simply do not trust!!

How can you terminate a php inc or class file without ?> ?
View user's profileFind all posts by joebSend private message


Joined: 11 May 2008
Posts: 78
Reply with quote
Yeah, that's why I do not use these functions (along with many other functions that cause crashes or instability or are just buggy), I just have no trust in them. Well, replace in files is useful, and when needed, I use more trusted applications to do that.
I see... newer versions still suffer from this bug. I've created a thread in the past about this if I remember correctly. Maybe it's too hard to reproduce and fix.

You can leave off the termination ?> from php files. It's written somewhere in the docs too. The PHP engine swtiches automatically out of PHP mode when quitting the file. If your file is entirely PHP, do not terminate them with ?> and you're ok. Then the IDE can add as many spaces as it wants with no adverse effects Smile .
View user's profileFind all posts by tedychSend private message
Veteran

Joined: 15 Nov 2003
Posts: 118
Reply with quote
It's 100% the refactor function. Im using V8 Build 8033 (latest version avaliable).

I refactored a method name that was in 2 files.

Both files had a blank line at the end. This is a serious error and needs fixing asap.
View user's profileFind all posts by joebSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
tedych wrote:
Yeah, that's why I do not use these functions (along with many other functions that cause crashes or instability or are just buggy),
If you got any single crash or bug in the latest build - why don't you report it?

tedych wrote:
I've created a thread in the past about this if I remember correctly. Maybe it's too hard to reproduce and fix.

Maybe it's just too hard... but sorry, this is not a correct place for reporting bugs.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
searching for files that have a blank line at the end
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic