How to modify nextcloud code?

I want to learn how to modify Nextcloud code. The Sessions display on the Personal page looks easy, so I’m starting there.

I found the settings/templates/personal.php file that creates the table to hold the sessions.

I can’t find where the sessions are stored or how the the sessions are put into personal.php.

Any hints for learning Nextcloud code?

The best way to learn more about the Nextcloud code is to do some small stuff. For example you could look at the starter issues at Github or work on some small improvement or bug fix you have in mind.

In order to get an idea how the code works, which classes exists, etc. I think it is useful to use a IDE with good PHP support. This way you can jump through the code and get an idea how things belong together. Also a integrated debugger can be really helpful. This way you can set a break point and then look at the stack trace to see which code path lead you to the break point and move forward step by step to see how the code path continues.

I hope this are some useful tips for you.

What IDE do you use? I have a copy of IntelliJ that I can use.

IntelliJ isn’t that suitable (as it’s meant to be for Java projects). Better use PhpStorm, if you want to stick to IDEA. They don’t offer a community edition though. It’s about $199/year. (For open source projects it’s actually free, but only for core members and those who submit often).
Personally I prefer to use NetBeans. It’s free and has PHP support.