NetBeans-Xdebug可以运行,但是不会公开一些PHP变量 [英] NetBeans-Xdebug works, but won't expose some PHP variables

查看:102
本文介绍了NetBeans-Xdebug可以运行,但是不会公开一些PHP变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新-致力于在phpDeveloper/Xdebug进行中获得WAMP.我仍然想要NetBeans -我只想比较一下,看看是否能获得一些见识.


我正在将 NetBeans 6.9 LAMP Xdebug 一起用于PHP代码.变量显示效果很好,但最近效果不佳.例如,在下面的示例中,$authorized应该在代码下方的变量窗格中可见,并应显示其值.但是它不显示,也不显示其值,将鼠标悬停在代码上也无济于事. ($this对象正在显示,并且确实会不断显示,但是$authorized不在其中,如果存在,则没有任何意义.)

此行为是一致的.也许是代码复杂度的函数?还是猖object的对象用法?当我开始使用CodeIgniter时,它似乎已经开始.

当然,当我最需要它们时,这些变量是隐藏的...对穷人来说似乎如此.我想念什么?

NetBeans调试器http://themanthursday.com/wiki/Debugger_Display.png

下面有一个更好的例子.当我单步执行此代码时,变量仅显示 Superglobals $ this ,如图所示.我看不到任何值,即使是字符串也是如此.

(Na念:我敢打赌,$ CI SuperObject与所有这些都有关……)

class Product_documents {
  function getProductImage_all($id)
//Return an array of all documents for this product
{
  $imgPath = $this->_getProductImage_folder($id);
  $arrayPossibleFilenames = $this->_getProductImage_possible_files($id);
  foreach ($arrayPossibleFilenames as $imgFile) {
    $imgPathFull = $imgPath.$imgFile;

    $file_exists = get_file_info($imgPathFull);
    if ($file_exists) 
    {
    $arrayFilesPresent[] = $imgPathFull;
    }
  }
  return $arrayFilesPresent;        
}
}

解决方案

右键单击变量窗格.选择过滤器".您会找到秘密的.

UPDATE -- working on getting WAMP with phpDeveloper/Xdebug going. I still want NetBeans -- I just want to compare, see if I get some insights.


I am using NetBeans 6.9 with LAMP and Xdebug to work on PHP code. The Variables display works well, but lately it works less well. For example below, $authorized should be visible in the variables pane below the code and should expose its value. But it doesn't show, nor its value, and mousing over the code doesn't help. (The $this object is showing and it does go on and on, but $authorized isn't in there, and it wouldn't make sense if it were.)

This behavior is consistent. Maybe it's a function of the complexity of the code? Or rampant object usage? it seems to have started when I took up CodeIgniter.

Of course the variables are hidden when I need them most ... or so it seems to the poor human. What am I missing?

NetBeans debugger http://themanthursday.com/wiki/Debugger_Display.png

There's a better example below. When I'm stepping through this code, Variables displays only Superglobals and $this, just as in the picture. I can't see any values, even mere strings.

(Nagging thought: I bet the $CI SuperObject has something to do with all this ...)

class Product_documents {
  function getProductImage_all($id)
//Return an array of all documents for this product
{
  $imgPath = $this->_getProductImage_folder($id);
  $arrayPossibleFilenames = $this->_getProductImage_possible_files($id);
  foreach ($arrayPossibleFilenames as $imgFile) {
    $imgPathFull = $imgPath.$imgFile;

    $file_exists = get_file_info($imgPathFull);
    if ($file_exists) 
    {
    $arrayFilesPresent[] = $imgPathFull;
    }
  }
  return $arrayFilesPresent;        
}
}

解决方案

Right click on the variable pane. Select "Filters". You will find the secret.

这篇关于NetBeans-Xdebug可以运行,但是不会公开一些PHP变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆