NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code compile check


Joined: 26 May 2007
Posts: 40
Reply with quote
LuckaSoft's EnginSite PHP Editor has a function that allows for checking the code for runtime errors on demand. Would be nice to have that in NuSphere's PHPEd as well. The squiggly lines and the red dash in the scrollbar just don't cut it.
View user's profileFind all posts by RamonSSend private message
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
How would that work? The only way to check for runtime errors in code is to, well, run it. In most cases, randomly running your code like this would be a bad thing.
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
The closest thing you can come to a runtime code analyzer right now is by using the Zend Code Analyzer. It's included in Zend Studio and it checks your code on a large number of coding mistakes and so on. It can be used as an integration tool in PhpED (that's how I do it). Unfortunately this tool is only included in Zend Studio and not available separately, so you could download a trial version and just get the ZendCodeAnalyzer.exe file from the installation folder and add it to PhpED.
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 26 May 2007
Posts: 40
Reply with quote
What the checker in EnginSite does is parsing through the entire file and indicating unknown keywords, missing braces, missing semicolons, falsely crafted if and switch statements, etc. PHPEd does this already, but it indicates any error only by some squiggly line that for a missing or extra brace can be fairly small and the red dash somewhere in the right scroll bar.
I think that is not obvious enough and a bit more verbose reporting will help a lot. The squiggly line indicates only that something is broken, but there is no indication as to what. I find it quite annoying to go a dozen scripts deep into my project just to find out that I missed some equal sign somewhere.

Yea, I know, it is my fault for writing buggy code, but it happens.
View user's profileFind all posts by RamonSSend private message
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
So what you're really asking for is just a way to make errors more obvious. On that, I agree, and I believe it's been requested a few times in the past.

I'd really like to have a separate Check Syntax command that simply selects the first syntax error and generates an explanatory error message. I use a similar command all the time in BBEdit and love it. Any way to do this in PhpED?
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
Which is exactly what ZendCodeAnalyzer does (and more)... just check into it, it's perfectly usable as an integration tool.
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 26 May 2007
Posts: 40
Reply with quote
OK, while forking around in NuSphere I did come across the Instant Error Analysis function (CTRL+ALT+V), which is more like what I am looking for, but it doesn't detect unknown code words.

So, how do I integrate the ZendCodeAnalyzer into PHPEd Standard?
View user's profileFind all posts by RamonSSend private message
Veteran

Joined: 06 Jun 2007
Posts: 289
Location: Vancouver, Canada
Reply with quote
Ramon, does Instant Error Analysis do anything for PHP code? Because the Help says "Click to run html error analysis. The check is performed with CSE HTML Validator Lite", I have not even bothered to use it Confused

_________________
Smile
View user's profileFind all posts by annoSend private messageVisit poster's website


Joined: 26 May 2007
Posts: 40
Reply with quote
I removed a curly brace of an if block and it found that, but when I added an extra "a" into a PHP keyword there was no error message in the log tab. If it would have been an HTML validator checking I'd expect to see a few dozen errors reported when throwing PHP code at it.

I tried it without checking what it checks, but since I am using a PHP IDE I'd think that such a feature checks PHP code, not just HTML. And besides that, the Standard version supposedly does not have an HTML validator. That is no big deal as there are quite a few free ones that NuSphere really could have included, same applies for PHPDoc. My guess is that this was done to artificially make the Professional version look, well, more professional. That is a different story and the folks from NuSphere already got an earful for that.
View user's profileFind all posts by RamonSSend private message
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
Blizz wrote:
Which is exactly what ZendCodeAnalyzer does (and more)... just check into it, it's perfectly usable as an integration tool.


The problem is that Zend Studio is licensed software, so pulling the analyzer tool from the trial version for use with PhpED is almost certainly a license violation -- and, consequently, a risky move with my employer (not to mention, an ethically challenged move).

What really needs to happen is for NuSphere to either make their own version, or for them to license the Zend tool for inclusion with PhpED.
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website


Joined: 26 May 2007
Posts: 40
Reply with quote
Or license it from Luckasoft, because that one works great.
View user's profileFind all posts by RamonSSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
bobwilliams wrote:
The problem is that Zend Studio is licensed software, so pulling the analyzer tool from the trial version for use with PhpED is almost certainly a license violation -- and, consequently, a risky move with my employer (not to mention, an ethically challenged move).


I can imagine that being a problem for people, although I don't know their EULA. As I have a perpetual license on Zend Studio I don't keep that sort of things in mind.
Made the mistake of going for that first, before I decided to go for PhpED Wink
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Code compile check
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 2  

  
  
 Reply to topic