I am having an application in which there is a dumper action which continuously retrieves an xml stream from a web service parse it and then dumps it into a mysql DB.
Right now i am doing all the dumping action in the UI and its a real pain to both dump the data and manipulate it.
So i made a separate CLI script which will take care of the dumping action and the front end can just poll the DB every second to see if it has new data which would be a much more trivial way of doing it. But the only problem now is that i am not able to control the cli script from the web UI.
That is i want to be able to start the dumping action and stop it from the UI. I tried this method that ive seen somewhere before
while(true) {
if(file_exist($file)) {
//do action
} else {
break;
}
}
so ill delete the file on stop action from the frontend and there are variable problems with this method and all this doesnt seem like the correct way of doing it. So is there a better way to control Command line scripts from the Web page UI.