phpStorm debugger not stopping on lines in my new service-container marked with a break-point, but it does in controllers and included files

大憨熊 提交于 2020-02-06 08:05:07

问题


Using Symfony v2.8 and phpStorm v2016 3.3, I am currently able to run x-debugger on my controller files located in the .../src/AppBundle/Controller directory and the include/require files located in subdirectories located below the Controller directory. Recently, I added a Service directory to .../src/AppBundle, and create, configure, and successfully execute an example service container that I found in the Symfony documentation, but I couldn't run x-debugger from phpStorm on the code in new service container when I put an debug mark next to the service container's line where I wanted to break. The red disc changed to a red disc with a x inside indicating that the directory wasn't mapped. With that example running, just not debugging, I put my own service-controller file in the Service directory, configured it, and am able to run it, but still can debug it. Again, no errors are being displayed when I run it, but the x shows in the debug break-point marker.

I tried to fix this by changing the top directory of my project one level up, .../src/AppBundle/Controller to .../src/AppBundle, the parent of Controller and Service. I also changed this in the server-side mapping, and I added two new include directories: .../src/AppBundle/Server and .../src/Appbundle/Controller.

Note the actual directories include the full path names, not actually the .../src/AppBundle/Controller and .../src/AppBundle, as I show here.

After making all of these changes, I can still run the debugger and break on marked lines in the files contained under the .../src/AppBundle/Controller and its subdirectories, so the top level directory change appears to be working.

I don't think that this isn't a protection issue, because I can access the service container file using FileZilla to upload changes I make to the service container, and I use the same account in both programs.

I know that the code is actually running, because I get back a FALSE value inspecting the $this->loggedin variable and I can see the $message is being set. Here is the code that makes the call to the service-container:

$this->loggedin = empty( $message = $this->container
                                         ->get( 'app.checkloggedin' )
                                         ->checkLoggedIn( $this,
                                                          $userData,
                                                          $userData ) );

I'm placing the break-point on this line and the next one after it.

What am I missing here?

P.S., The documentation concerning service-container say that they only load once when they are first called. In my code I don't assign the $this->container->get(...) to a variable, so in other functions in the same controller, when I call the above, again, will the class/method(s) still only be loaded once or do I need to assign the get(...) results to a variable to ensure it loads only once?

来源:https://stackoverflow.com/questions/57949630/phpstorm-debugger-not-stopping-on-lines-in-my-new-service-container-marked-with

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!