Is it possible to run PHP code in the background using TideSDK? I am trying to upload a file using curl in PHP. The GUI becomes unresponsive during the upload whether Javascript calls PHP immediately in response to an event or whether the event is used to schedule the call.
Javascript calls PHP directly from handler:
upload_file(path_to_file)
Javascript schedules call to PHP directly from handler:
setTimeout(function() {upload_file(path_to_file);}, 250);
The file upload is done using the PHP curl function. I’ve tried both curl_exec() and curl_multi_exec(). curl_multi_exec() seems promising but the example code spins calling curl_multi_exec() repeatedly.
I’m considering breaking this loop up to return back to JS between loops to attempt to help the problem.
AFAIK its not possible. THe only way around this I found was to run the background process using the Ti.Process – which is basically running your script via CLI. However, I was only targeting one platform – osx.