I am creating a small plugin that processes some images. Now, to report the progress to the user, I have a small ajax script that will check the results for a long time.
Now I need an object that keeps track of what is being processed. Now the options that I know of are as follows.
Using a PHP session object. I cannot use this in this particular case, because the initial process also runs ajax. So the main process is the ajax call, and the long ajax polling is another ajax call. They have two different session identifiers, so they do not communicate well.
The second option is to use the database as a repository. I donโt know if this is good, because the average job will have about 40 read / write operations. I know this is not a problem, but it seems a little big for something so simple.
What I'm really looking for is a kind of memory object, if possible. Create a small object in memory that updates quickly with the move and is deleted when we are done.
I don't know if this is possible, such a thing exists in PHP, and I can use it. Please note that this will be a public plugin, so I need to work with methods that are available for all types of systems, nothing special.
source share