I'm building a gallery system, part of which imports and exports images from facebook. The problem I'm having is that when you have a lot of source images to copy (~150), the user has to spend a lot of time looking at an inactive screen.
Does anyone know if you can send this operation to a background thread using Curl or HttpRequest? Is there any special way you would have to handle the facebook auth?
Ideally, i'd like to post users back to a page saying that the images are on there way, but in the mean time can carry on with what they are doing.
Thanks in advance
Write a script that does all the work. You can either executing via a scheduler, or using system/exec calls and run it as a background job.
exec('php /path/to/my/script.php &');
PHP wont wait for the script to finish. But it will continue to run in the background.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.