0

I use php to develop a tool where user can upload their apk file and test write in Calabash

They click run test then my tool will run this test and return result for user

I use exec() in php to run test command (in window), then push result to a txt file

So i dont know how to check when test end to notify to user via email and show status of test process, can any one help me?

sorry for my bad english

1 Answers1

0

Use a database table called jobs. When a user submits an upload, create a row in the database table with a status of 'uploaded'. Then, when exec() runs, update the database table row to have a status of 'running', when exec() finished update the table row to have a status of 'complete'.

To email end user when it's finished, use a cron job that runs every X minutes. In that cron job, query the database for status 'complete' within the past X minutes.

To show the end user on a page, use Javascript and AJAX to hit a PHP script every few seconds asking for the status of that job ID.

Lee Salminen
  • 900
  • 8
  • 18