drd0833 2017-03-03 22:53 采纳率: 100%
浏览 122
已采纳

NetBeans不会在PHP代码中的某些断点上停止

I have problem with xdebug because don't stop in some breakpoints.

My project have MVC architecture and all worked fine with debugging while I created subcontrollers, because in subcontrollers breakpoints not working. If I put xdebug_break() in subcontroller then it works.

I checked xdebug_remote.log

This breakpoint not working

<- breakpoint_set -i 1309 -t line -s enabled -f file:///var/www/my_project/app/controllers/settings/LanguageController.php -n 18
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1309" state="enabled" id="59770002"></response>

This breakpoint working

<- breakpoint_set -i 1310 -t line -s enabled -f file:///var/www/my_project/app/controllers/IndexController.php -n 15
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1310" state="enabled" id="59770003"></response>

It's possible, that namespace is guilty? One difference between controller and subcontroller is namespace. In controller is it not defined, but in subcontroller is defined.

  • 写回答

1条回答 默认 最新

  • dousheyan0375 2017-03-04 12:57
    关注

    I solved the problem. I changed the namespace to lowercase before was in camelcase and I changed register namespace on exactly folder structure.

    Before in controller:

    namespace MyApp\Controllers\Settings;
    

    in loader.php

    $loader->registerNamespaces( [ 'MyApp\Controllers\Settings' => DIR.'/../controllers/settings' ] )->register();
    

    After (properly working)

    in controller:

    namespace app\controllers\settings;
    

    in loader.php

    $loader->registerNamespaces( [ 'app\controllers\settings' => DIR.'/../controllers/settings' ] )->register();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 内网办公电脑进行向日葵
  • ¥15 如何输入双曲线的参数a然后画出双曲线?我输入处理函数加上后就没有用了,不知道怎么回事去掉后双曲线可以画出来
  • ¥50 WPF Lidgren.Network.Core2连接问题
  • ¥15 soildworks装配体的尺寸问题
  • ¥100 有偿寻云闪付SDK转URL技术
  • ¥30 基于信创PC发布的QT应用如何跨用户启动后输入中文
  • ¥20 非root手机,如何精准控制手机流量消耗的大小,如20M
  • ¥15 远程安装一下vasp
  • ¥15 自己做的代码上传图片时,报错
  • ¥15 Lingo线性规划模型怎么搭建