Source for nextcoud updater/index.php?

I’m trying to learn more about asynchronous PHP programming. The nextcloud updater is a good example of what I’m trying to achieve in my own projects. In particular, I like the way it’s able to complete a number of complex steps in the background one at a time and provide status and feedback through the web interface.

It seems to be a single monolithic php/css/html/javascript file with lots of interesting behavior.

I can’t seem to find the source in GitHub, so I’m assuming it’s “compiled” in some way from other components.

My questions:

  1. Is this home grown tech, or are some frameworks or libraries involved?
  2. Is there a name for this kind of development? ie: what else should I Google

Thanks!

I think nextcloud is a complex example. Perhaps you like the source code of Tiny File Manager. It is only one file with a few external scripts from external CDNs.

So what you are really looking for is the concept of IPC, which is for Inter-Process Communication. Basically, you have two or more processes. One is a data producer (in this case, the process that is performing the actual update functionality), which generates information and sends it out via some IPC mechanism. The rest of the processes are consumers, which hook into the IPC mechanism in order to receive and use/display the information.

IPC can be done by all kinds of things, like sysvipc, pipes, database, nosql (like redis), etc.

Now you have a few choices if your goal is to output status updates to a web browser. You can either repeatedly check (poll) a script that dumps out status updates, or better, you can use SSE to listen for new events to be written along a single connection. The end result is similar, which is that you are going to be performing data updates on what is being displayed, usually by altering the DOM with javascript.

So you get that? One script runs the update, which writes status updates out to IPC. One reads from the IPC and does something with the data.

Have fun, but don’t think that there is something special or magical about what Nextcloud is doing here.