NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
interpreting what is php code and is debuggable


Joined: 28 Jun 2006
Posts: 92
Reply with quote
Difference between lines containing debuggable PHP code and those that do not; improper detection of what is considered debuggable...

Example in the code block:
Code:
  <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
    <?php if ($picture) {
      print $picture;
    }?>

the line:
Code:
<?php if ($picture) {

has PHP code in it, but because it is not already containing with a <?php script block open tag occurring before the start of the line, the gui doesn't let me click on the line number to set a break point. I can get around it both by moving the <?php opening tag up a line or right-clicking and choosing "Toggle Breakpoint" and it works fine, but I think the debugger should be able to be set by clicking normally as well...

thanks
View user's profileFind all posts by bcswebstudioSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
there are no bugs with that:)
From php perspectives and from the IDE perspectives as well, all those code chunks are on the same line.
Since breakpoint can be set on a line, not on code chunk, it will be set to the line and trigger as soon as code is executed on that line.
To make code chunks distinguishable, put them on different lines or better don't use this approach altogether and switch to templates like Smarty Smile (just a recommendation)

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Jun 2006
Posts: 92
Reply with quote
I'm referring not to distinguishing between two code chunks per line when a breakpoint is set on the line of code but rather to the fact that I can't Click a little red breakpoint on that line whereas I can still right-click and set via the context menu. Just seems inconsistent is all, and since the breakpoint still works as expected, I figured it had to be a parsing thing-- the only cause I could see was that perhaps the IDE was not catching that that line in fact has inspectable code. But you're the man behind the IDE, and if you say that behavior is by design, then it's not a bug.. I can't possibly criticize this awesome software, and the debugger has been so useful to me lately.

Incidently, this is within a phptemplate (drupal cms' default templating system). Smarty.. Wink
View user's profileFind all posts by bcswebstudioSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
the fact that I can't Click a little red breakpoint on that line

You can. Just put cursor in php code (somewhere between <? and ?>) and click on the gutter.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Jun 2006
Posts: 92
Reply with quote
Dmitri-
That's just my point. Even on an existing breakpoint (set "manually" via context menu), no matter where my cursor is in the line that contains any number or php code blocks or just one that opens and begins code without linebreak immediately following the opening tag, I cannot click the gutter to toggle a breakpoint.

My observations: the only clickable lines of code:
- contain only "<?php"
- do not begin with "<?php" or html, no matter what code/html/blocks follow on the line
- contain only php code
- begins with only php code and has "<?php" only following some amount of php code

If you cannot reproduce my observation by saving my quoted code to a php file and trying what you suggested, then I will continue again looking for other factors that might be affecting my testing. Prior to responding, I picked up the latest upgrade build (4.6.2) to see if it was an issue resolved between 4.6.1 and 4.6.2.

-bronius
View user's profileFind all posts by bcswebstudioSend private message
simple bug, still persists


Joined: 28 Jun 2006
Posts: 92
Reply with quote
dmitri- I am certain this is a bug, and it still exists in the 4633 release. Here is a sample snippet of code that can be used to verify:
Code:
      </a>
      <a href="/functchooser.php" class="<?php echo((isCurrentPage("funct")) ? " selected" : ""); ?>">Functions
         <div class="showhide">Functions, documents, and contact information organized by Function</div>

There are three lines above (browser-wrap may make it appear as more, but there are only three line breaks). The 2nd line contains a single-line php island. The expected behavior is that clicking into the gutter while the cursor is between the <? and ?> will set a red dot/breakpoint on the line. This doesn't happen. Instead, the cursor just hops to position column 1.

thanks
View user's profileFind all posts by bcswebstudioSend private message


Joined: 28 Jun 2006
Posts: 92
Reply with quote
Code:

<style>
body {
   <?php setStyleOverride(); ?>
}
</style>

Another, more simple code snippet just to have more test cases.. Note, F5 still works as expected throughout.
View user's profileFind all posts by bcswebstudioSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Indeed, that line begins with html and ends with html.
If you need a breakpoint on it, just press F5 while cursor is in PHP.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Jun 2006
Posts: 92
Reply with quote
Oh, that's the way it's supposed to work..?
Is there any reason that it couldn't be made to allow for a breakpoint to be set there by clicking in the gutter governed by the same rules as hitting F5?
View user's profileFind all posts by bcswebstudioSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
it would work, but when you click on the gutter editor first moves cursor to the leftmost position and therefore it's html is under cursor when code reaches setting breakpoint part.
if editor did not move cursor there, it would be hard to select multiple lines by dragging mouse on the gutter.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Jun 2006
Posts: 92
Reply with quote
Oh, I see.. ok, that's a bit of a conundrum then. I would still like to see it, but I can also appreciate the present difficulty in achieving it (and won't push for it anymore.). Hopefully, also, this thread is stuffed with the keywords needed so some future seeker of this feature will hit here first..

thanks dmitri
View user's profileFind all posts by bcswebstudioSend private message
interpreting what is php code and is debuggable
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