I am intrigued about NextCloud the possibility that I can control my own data is really good. That’s why I am interested in how I could develop apps to it.
I would like to know what kind of setups you have on developing. If you are running on Docker etc. And how you can debug your controller code with VS Code. Is there a way to run my app so that I could add breakpoints etc. to my PHP-controllers and see what is happening when I run this on the development Nextcloud instance?
And yes, step debugging is possible with a local dev instance of the NC server. You will need to setup some path mappings. As maintainer of the cookbook app, I am just linking that code here for reference.
If you run into issues, just ping me. If you need more information or have further questions, feel free to ask!
I am still having trouble attaching the debugger to the VSCode. I downloaded the setup by Julius Haertl and got the env running. I have even tried that I can access my host from the docker container.
But when I start the debugger in the VSCode, nothing happens even when I should hit a breakpoint. I ran the “./scripts/php-mod-config nextcloud xdebug.mode debug” command. But still I cannot get any connection to my VSCode. I also tried PhpStorm but the issue is the same.
I someone could help a Php - noob, I would greatly appreciate it.
@stuma I am sorry, but your like is a bit unclear to me. Do you want to express your thank for the offer to help with VS code or confirm the need to/wish to use it? In the first case, I would be done with the topic in the latter, I would write and try to help at best.
You would need to set xdebug.log_level to 7 or similar using the command scripts/php-mod-config nextcloud xdebug.log_level 7. In a similar manner you can reset to 1 after having done the debugging of the connection.
Open the docker logs with docker compose logs -f --tail 1 nextcloud. Keep an eye on the output while you try with VS code to open a debugging session. There you can see
if a debugging session was requested
if the VS code is accepting requests by PHP for a debugging session
the path mappings and check manually if they match up with the actual paths
Thank you for the update. I just was so excited that I got the PhpStorm working, so I did not want to rock the boat yet. I will try this in VSCode also so this is really great.